Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
paintballer4lfe

Scripts Package

Recommended Posts

I hope i don't get too much slack for asking such a noob question.

I have Eclipse setup with tribot and all that but inside my src folder i have my "Scripts" package than all of my scripts are in there.(dabbled in this way back in the day) But for some reason when i save the script changes in eclipse and load my tribot and only load local scripts the menu is completely empty. Again really sorry to be asking such a straight forward question but im a little confused if i'm missing something or the structure isn't right.

Here is my project structure
86aabdc5f9194d029f4339868f2f785b.png

Share this post


Link to post
Share on other sites

Man i love coding in c# and VS Studio for reasons like this LOL. Thanks for the heads up @Optimus

I don't get it, the src folder is setup and showing in the project's Java Build Path unless im doing something ass backwards. Honestly i'm not super nooby to coding just with Eclipse and Java in general lol.

I cleared out the project to re make and it's still not showing the src as source folder in nav view.cb59fcf40ecb5f5331b46e3f87acd135.pngca7d68f7d8c4adcfbc37b5725566415d.png

Share this post


Link to post
Share on other sites

Yup just added tribot.jar as external and the script does extend Scripts. This is my code btw lol
 

package scripts;
import org.tribot.api.General;
import org.tribot.api2007.Inventory;
import org.tribot.api2007.NPCs;
import org.tribot.api2007.Objects;
import org.tribot.api2007.Walking;
import org.tribot.api2007.types.RSNPC;
import org.tribot.api2007.types.RSObject;
import org.tribot.script.Script;
import org.tribot.script.ScriptManifest;

import jdk.nashorn.internal.runtime.Timing;
@ScriptManifest(authors = { "paintballer4lfe" }, category = "Tools", name = "Test Script", version = 1.00, description = "First testing script.", gameMode = 1)
public class TutorialAuto extends Script {

 @Override
 public void run() {
  while (true) {
   sleep(50);
   this.println("This shit work yet?");
   }
  }
 }
}

 

Share this post


Link to post
Share on other sites
1 hour ago, paintballer4lfe said:

Yup just added tribot.jar as external and the script does extend Scripts. This is my code btw lol
 

package scripts;
import org.tribot.api.General;
import org.tribot.api2007.Inventory;
import org.tribot.api2007.NPCs;
import org.tribot.api2007.Objects;
import org.tribot.api2007.Walking;
import org.tribot.api2007.types.RSNPC;
import org.tribot.api2007.types.RSObject;
import org.tribot.script.Script;
import org.tribot.script.ScriptManifest;

import jdk.nashorn.internal.runtime.Timing;
@ScriptManifest(authors = { "paintballer4lfe" }, category = "Tools", name = "Test Script", version = 1.00, description = "First testing script.", gameMode = 1)
public class TutorialAuto extends Script {

 @Override
 public void run() {
  while (true) {
   sleep(50);
   this.println("This shit work yet?");
   }
  }
 }
}

 

Does eclipse properly build it and give you .class files anywhere?

Share this post


Link to post
Share on other sites

Not sure if i should start a new thread but i feel like something like this is easier than im trying to make it or something lol.

 

When i disable the autologin and try to manually login if the login does not work it just tries to login over and over until i stop script.

Is this not the right way to handle a manual login request? i just need it to try the login once then return false if failed.

boolean isLoggedIn = Login.login(username,password);
Login.STATE status = Login.getLoginState();

Then from there it would return the STATE enum itself, or am i missing something?

Share this post


Link to post
Share on other sites
2 minutes ago, paintballer4lfe said:

Not sure if i should start a new thread but i feel like something like this is easier than im trying to make it or something lol.

 

When i disable the autologin and try to manually login if the login does not work it just tries to login over and over until i stop script.

Is this not the right way to handle a manual login request? i just need it to try the login once then return false if failed.

boolean isLoggedIn = Login.login(username,password);
Login.STATE status = Login.getLoginState();

Then from there it would return the STATE enum itself, or am i missing something?

Showing your whole code would help to understand exactly what you're trying to do

Share this post


Link to post
Share on other sites

Nothing fancy to be honest, i wanted to make my own mule account kinda of script (yeah i know there are some already, want to tweak to my play style) and just make a simple login function so i can load a list of my throw away accounts and login and bot on them one by one for whatever skill i have it doing.

The function is pretty straight forward

public boolean StartMoneyMaking(String username, String password){
		 boolean isLoggedIn = Login.login(username,password);	
		 Login.STATE status = Login.getLoginState();
		 String response = Login.getLoginResponse();
		 this.println(response); // Debug purpose
		 if(isLoggedIn) {return true;}
		 else {return false;}
}

Side note also: i've never debugged with this before, im use to VS Studio where i can go step by step. This hits the bool Login and just tries over and over and over and over until i stop the script

Edited by paintballer4lfe

Share this post


Link to post
Share on other sites
8 minutes ago, paintballer4lfe said:

Nothing fancy to be honest, i wanted to make my own mule account kinda of script (yeah i know there are some already, want to tweak to my play style) and just make a simple login function so i can load a list of my throw away accounts and login and bot on them one by one for whatever skill i have it doing.

The function is pretty straight forward

public boolean StartMoneyMaking(String username, String password){
		 boolean isLoggedIn = Login.login(username,password);	
		 Login.STATE status = Login.getLoginState();
		 String response = Login.getLoginResponse();
		 this.println(response); // Debug purpose
		 if(isLoggedIn) {return true;}
		 else {return false;}
}

Side note also: i've never debugged with this before, im use to VS Studio where i can go step by step. This hits the bool Login and just tries over and over and over and over until i stop the script

The proper way to check if you're logged in is Login.getLoginState() == STATE.INGAME

Share this post


Link to post
Share on other sites
57 minutes ago, paintballer4lfe said:

Not sure if i should start a new thread but i feel like something like this is easier than im trying to make it or something lol.

 

When i disable the autologin and try to manually login if the login does not work it just tries to login over and over until i stop script.

Is this not the right way to handle a manual login request? i just need it to try the login once then return false if failed.

boolean isLoggedIn = Login.login(username,password);
Login.STATE status = Login.getLoginState();

Then from there it would return the STATE enum itself, or am i missing something?

you said it keeps trying to login in over and over again. what happens when it tries to login, does it get user/pass incorrect or mistype it or connection failed or already logged in like what is the reason it doesn't login?
I've had problems where if an account is already logged in and another bot tries to login to that account then the login.login(user, pass) never returns false and just keeps trying to login and never exits the login() method. super annoying but im not sure if that's the same problem you're having

Share this post


Link to post
Share on other sites
11 minutes ago, lets be friends said:

you said it keeps trying to login in over and over again. what happens when it tries to login, does it get user/pass incorrect or mistype it or connection failed or already logged in like what is the reason it doesn't login?
I've had problems where if an account is already logged in and another bot tries to login to that account then the login.login(user, pass) never returns false and just keeps trying to login and never exits the login() method. super annoying but im not sure if that's the same problem you're having

It literally just loops this idk why, obviously the user and pass are wrong on purpose lol

1244899c67f78cfa9cb31e50e882b7cd.gif

Edited by paintballer4lfe

Share this post


Link to post
Share on other sites
14 minutes ago, paintballer4lfe said:

It literally just loops this idk why, obviously the user and pass are wrong on purpose lol

1244899c67f78cfa9cb31e50e882b7cd.gif

Are you repeatedly calling the method? I believe it will try a few times to make sure it typed everything correctly and then return false

Share this post


Link to post
Share on other sites
3 minutes ago, Naton said:

Are you repeatedly calling the method? I believe it will try a few times to make sure it typed everything correctly and then return false

Ahhhhhhhhhhh that's it wow i didn't realize it was that fancy LOL, it failed 4-5 times then reported bad that's insane and now i look like more of a coding noob, o weel lol cheers guys!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Our picks

    • This update features:

      Fixed broken hooks from today's update


      Fix wilderness level with RuneLite (Thanks @Todd)


      Add support for Kotlin .class files in scripts (Thanks @wastedbro)


      Overhaul Inventory API (Thanks @wastedbro)


      Add List support for common methods


      Change method grouping to make more sense (by functionality)


      Refactor methods to utilize Java 8 streams instead of cumbersome loops




      Recognize chatbox minimization (Thanks @JoeDezzy1)


      Fix Screen#isInViewport when NPC chat is open (Thanks @JoeDezzy1)


      Fix login bot bugs (Thanks @erickho123)


      Fix hint arrow return values (Thanks @Encoded)


      Fix depositAllExcept functionality (Thanks @wastedbro)


      Change containing box interface bound and adjust for Y values (Thanks @erickho123)
      • 151 replies
    • This release will:

      Fix prayers and world hopper API (Thanks @JoeDezzy1 and @erickho123)


      Improve banking API (Thanks @Encoded)


      Adds methods for returning and using Java Lists, rather than arrays


      Slightly randomizes some hardcoded behaviour


      Removes sleeps from waitConditions; the efficiency saving potential is negligible in these use-cases, therefore cleaner code is preferable


      Other back-end improvements





      Note: If you are using LG, please restart both the RS client and TRiBot.
      • 90 replies
    • This release will:

      Add new internal framework for capturing exceptions


      Fix issue with not selecting the last column in world hopper (Thanks @Todd)


      Add a message about pin usage in Banking#openBank (Thanks @Todd)


      Disable the firewall by default (Thanks @Todd)


      Fix handling of the welcome screen after login (Thanks @Encoded)


      Fix wrong amount bank withdrawal (Thanks @Encoded)


      Fix Screen#isInViewport


      Fix Game#isInViewport (Thanks @Encoded)


      Call onBreakEnd for ListenerManager Breaking Listeners (Thanks @Encoded)


      Fix Prayer#getPrayerPoints NumberFormatException (Thanks @JoeDezzy1)



      Note: If you are using LG, please restart both the RS client and TRiBot.
      • 28 replies
    • This release will:

      Fix LG for both OSBuddy and RuneLite


      Fix issue where the resizable client isn't able to be made smaller (Thanks @JoeDezzy1)


      Fix detection of the logout game tab when resizable mode and side panels are enabled (Thanks @JoeDezzy1)


      Add initial support for Sentry to allow us to identify and easily debug exceptions happening with all TRiBot users


      Add methods to determine if the bank is actually loaded, and not just the overarching interface (Thanks @wastedbro)



      Upcoming updates:

      Improved CLI support


      Full Sentry support


      Much more
      • 64 replies
    • This release will:

      Fix NPE in Camera API (Thanks @wastedbro)


      Update deposit box interface ids (Thanks @Encoded)


      Add various bank methods (Thanks @wastedbro)


      Banking#getWithdrawXQuantity


      Banking#getDefaultWithdrawQuantity


      Banking#arePlaceholdersOn




      Fix resizeable minimap bug (Thanks @wastedbro)


      Remove Java 8 requirement


      Please note: TRiBot is not yet fully compatible with Java 10+




      Fix the break handler issues by ensuring the break handler thread never gets paused


      Fix broken settings hooks



      Upcoming updates:

      Improved CLI support


      Much more



      Note: If you are using LG, please restart both the RS client and TRiBot
      • 68 replies
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...