Welcome to TRiBot Forums

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

seany123456

Registered
  • Content count

    67
  • Joined

  • Last visited

  • Feedback

    0%

Everything posted by seany123456

  1. I really love this service! its so easy to use and works so well. trusted people running it so you know you're always going to be safe! Thanks!
  2. is there a bug with the world hopper atm? im using ingame world hopping and it seems to be getting stuck trying to switch to the world its already on.
  3. Script seems to get stuck at vannaka when switching to using the ranged items. this doesn't happen every time and if i left it, it might fix itself but seems to take a long time to fix itself.
  4. Hello, I have the code below upon testing it usually works fine, but sometimes it will throw a NullPointException if (DynamicClicking.clickRSModel(myObject[0].getModel(), "optionText")) { sleep(300, 500); Timing.waitCondition(new Condition() { @Override public boolean active() { General.sleep(100); // Add this in to reduce CPU usage return Interfaces.get(219, 0) != null; } }, General.random(2000, 3000)); if (Interfaces.get(219, 0) != null) { if (Interfaces.get(219, 0).getChild(1).click()) { //<<<<<<<<<<<<<<< getting NullPointerException on this line. sleep(300, 500); Timing.waitCondition(new Condition() { @Override public boolean active() { General.sleep(100); // Add this in to reduce CPU usage return Interfaces.get(219, 0) == null; } }, General.random(10000, 15000)); } } } return; I don't understand why its not working, I thought by null checking it on the line before it would be all that is needed but it does sometimes throw an exception. any help would be great! thanks
  5. Thanks for your response and I appreciate the offer to discuss this with you, however i prefer to keep things like this in the scripting help section, allowing others with similar issues to help themselves too, I have taken what you've said and will try to implement that script logic into my code. Thank you for your continued help, its really appreciated!! I think i have this all sorted now with a good idea of how the code should look and how to prevent any null exceptions. thanks!!
  6. @YoHoJo @Butta can you let me know when your online, i would like to purchase some Tribot credits. Thanks
  7. Thanks for your helpful response, I have implemented what you advised and tested, it all seems to be working well. Previously i was using the length check but only once at the top of the block of code which dealt with the object, I'm guessing its better to length check each interaction to be 100% sure, also i'm wondering does the hover check need to be in the same condition as the isUptext? see below for example of what i mean. //previously: //with length check much further up the code && not checking hover in the isUptext condition if (myObject[0].getModel().hover()) { Timing.waitCondition(waitUntilHoverCondition, General.random(2000, 3000)); if (Game.isUptext("myObject uptext")) { if (DynamicClicking.clickRSModel(myObject[0].getModel(), "myObject Action")) { //now: //length check before interaction with object && hover check inside isUptext condition if (myObject.length > 0){ if (myObject[0].getModel().hover()) { Timing.waitCondition(waitUntilHoverCondition, General.random(2000, 3000)); if (myObject[0].getModel().hover() && Game.isUptext("myObject uptext")) { if (DynamicClicking.clickRSModel(myObject[0].getModel(), "myObject Action")) { i have implemented the revised code and its running very smoothly and without and problems, is this how Thanks for all your help! greatly appreciated.
  8. Thanks for your response, just a question, do i have to declare the Interfaces? this method is the only place this interface is used in the entire script so i didn't think it was important to declare them before use. but basically i need to do the null check in the same if condition so would this code below be sufficient?, or should i be null checking the component that i'm trying to click instead? if (DynamicClicking.clickRSModel(myObject[0].getModel(), "optionText")) { sleep(300, 500); Timing.waitCondition(new Condition() { @Override public boolean active() { General.sleep(100); return Interfaces.get(219, 0) != null; } }, General.random(2000, 3000)); if (Interfaces.isInterfaceValid(219)) { if (Interfaces.get(219, 0) != null && //<<< Does this need to be null checking the component { .getChild(1) } instead? Interfaces.get(219, 0).getChild(1).click()) { sleep(300, 500); Timing.waitCondition(new Condition() { @Override public boolean active() { General.sleep(100); return Interfaces.get(219, 0) == null; } }, General.random(10000, 15000)); } } } return;
  9. Im not sure then when i type Timing.wait eclipse gives the option of waitCondition, although i would still need to type in the newCondition(){} part in myself. with this code for example: package scripts; import org.tribot.api.General; import org.tribot.api.Timing; import org.tribot.api.types.generic.Condition; import org.tribot.api2007.Game; import org.tribot.script.Script; public class TimerTest extends Script { @Override public void run() { // TODO Auto-generated method stub Timing.waitCondition(new Condition(){ public boolean active() { General.sleep(100); // Add this in to reduce CPU usage return Game.isUptext("Test"); } }, General.random(2000, 3000)); Timing.waitCondition(new Condition(){ public boolean active() { General.sleep(100); // Add this in to reduce CPU usage return Game.isUptext("Test"); } }, General.random(2000, 3000)); } } it gives the the following files.
  10. thanks for the response, Im getting a new class for every time i use the following in my script... if (item[0].click("Use")) { Timing.waitCondition(new Condition() { @Override public boolean active() { General.sleep(100); // Add this in to reduce CPU usage return Game.isUptext("item uptext"); } }, General.random(2000, 3000)); } how do you implement it so it doesn't create a new class every time?
  11. for every time i use this in my script it creates a new class once the script has compiled, is this supposed to happen?
  12. hey, I'm trying to create a failsafe in my script, so if i get logged out accidentally or dced, the script will recognize that I'm not logged in and run the login method. I assumed its done in the run() loop or main loop of the script so i tried this @Override public void run() { if (onStart()) { while (true) { sleep(50); accountSwitcher(); customLogin(); while (Game.getGameState() == 30) { bank(); } } } } I'm guessing the above doesn't work until the loop completes and comes back to the start to see the condition is now false. EDIT: i have the LoginBot disabled so i can use my own custom login method. how would this be done? any help would be great! thanks.
  13. @Beg @FALSkills @Final Calibur I just wanted to say thanks to you guys for helping me with this.. looking at my code i see that i have to many while loops, i fell into doing it because i thought it was a way around potential else statements, instead i knew if the while statement was true then it would just stay in the loop until i did what i needed before breaking out. I do have a final question regarding the structure of a script, when the main run loop comes back round, whats the best way to let the script know where it left off? should i just use booleans for when each method is complete? sean
  14. Thanks for the help with cleaning my code, i shall add it and test it now. To answer why I'm not just placing the the Login.STATE check on the main loop, well within my code i currently use a lot of while loops, I canu guarantee that at least 1 of them might be an infinite loop , or if i have for example my account logs while performing the code below.. it would just continue to walk and never break back to the main loop. - even if my code is squeaky clean it would still need to sleep through the conditional sleeps etc, whereas with using a thread it knows instantly, so to my mind its more efficient. Walking.walkPath(firstPATH);
  15. Thanks for you're response! i have gone for this code: //thread run Thread t1 = new Thread(new Runnable(){ @Override public void run() { // TODO Auto-generated method stub while(true){ if (isPaused()){ //not sure if this should be a if or while? sleep(1000); } while(Login.getLoginState() != STATE.INGAME && !isPaused()){ //call custom login method here. println("not logged in, but should be! run customLogin"); customLogin(); sleep(1000); } sleep(100); } } }); it does seem to be working which is good, the only issue now is the customlogin is clashing with whatever is running in the main script which could cause issues, is there anyway to pause the main loop if the condition in the thread loop is true? sean
  16. if your suggesting put that in the main run() while loop then i have tried something similar to that already in the first post.
  17. yes i do utilize that, however as the auto login bot is disabled, it doesn't automatically detect if/when my account logs out unexpectedly, which is why I'm creating this fail safe to deal with those times. sean
  18. Thanks for your help. You're not wrong, LoginBot works brilliantly, however I'm creating a bot which can run 2+ accounts / script. i have now been playing about with using multi threading to accomplish what i need (code below), I was a slightly hesitant using multi threading, considering im fairly new and understand very little of threads, I do have a question regarding the thread; When testing i paused script via tribot, yet the thread seemed to continue running. how do i make the thread pause too? thanks sean Thread t1 = new Thread(new Runnable(){ @Override public void run() { // TODO Auto-generated method stub while(true){ while(Login.getLoginState() != STATE.INGAME){ //call custom login method here. println("not logged in!!"); sleep(1000); } } } });
  19. Thanks for you response, Ok, i shall make sure i use states enum in future, just to confirm it would like something like this?: Login.getLoginState().equals(Login.STATE.INGAME anyway the purpose of this post was to know of the best way to detect changes to the loginstate when the script is inside a while loop, i'm guessing this can only be done with multithreading? unless there is another way to have code working in the background sleeping until a conditions activates it.
  20. Thanks for your response, from what i understand login.states.ingame != null and Game.getGameState() == 30 work basically the same way? You say i wouldn't need multi threading to achieve this, I had not even thought to use multi threading, but that does sounds like a way to achieve what i need. sean
  21. Thanks for your response, i'm actually trying to work out how it might be possible to detect when I'm logged out, while other methods are running.
  22. Sorry i should have mentioned that, i do have the LoginBot disabled as i'm using my custom login.
  23. I have tested my proxy and know they are working and are fast, however when using the proxy with tribot, I get the world selector saying loading... then when logged in on the world hopper i just get this: anyone else getting this issue?
  24. solved. problem was with the authentication of the proxy, although it was letting me login, it wouldn't let me change worlds. very strange! anyway thanks.