Jump to content

Jar

Members
  • Posts

    12
  • Joined

  • Last visited

  • Feedback

    0%

Profile Information

  • Gender
    Male

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Jar's Achievements

Newbie

Newbie (1/10)

2

Reputation

  1. Well technically they're right in what they said, Like @Eagle Scripts stated " you have a semicolon at the declaration of your onLoop method. Your IDE most likely tells you that this is not possible. If you couldn't figure this out yourself this probably means that you don't have a single clue about what you're doing. " I would definitely suggest just reading a basic starter tutorial in the tutorial section, you're making below intermediate mistakes.. no disrespect either could just be a typo and you didn't notice, but I think it's more to the fact you didn't notice your error, especially when you're using Eclipse IDE which would have told you that isn't possible. Goodluck :). Yeah I completely get where you're coming from, however just felt a little sarcastic in your last response to him.. but you're right in what you're saying.
  2. " This is my first time using complicated snippets. " Which suggests he's been puzzling snippets ( from the snippet section ) together to create his expectation/script ( Which I guess isn't a bad route if you actually read the code and not just copy/paste ).. but it's irrelevant if he has or hasn't scripted before, he's here for help so it's only right to give him some..
  3. Replace onExit(); with onExit() Replace public void onStart(); with public void onStart() { and lastly the onLoop(); with onLoop() but the onLoop was already explained by @Slut That's all I can see from skimming over.. guess try executing and telling us the response & whether you got the expected outcome Suggestion - Use IDE such as IntelliJ Read start guide tutorials in the tutorial section.
  4. No problem, I managed to fix it by adding a if statement - if(!getTabs().isOpen(Tab.INVENTORY)) { } which made it work, but I still don't see why that is necessary, i should be able to just call " getTabs().open(Tab.INVENTORY); " but never mind it works now i guess..
  5. The conditional sleep isn't waiting for the inventory tab to be open... it's waiting for the next stage of the tutorial which in this case is " Fishing " which appears in chatbox after clicking inventory tab
  6. That's the strange thing, it still executes ConditionalSleep even though inventory is not open..
  7. My conditional sleep is executing, before it's completed the set task above it, I'm not sure why though? Example of code ( This was my first attempt ) - ( but it kept running the conditional sleep, before even clicking inventory tab ) getTabs().open(Tab.INVENTORY); new ConditionalSleep(15000, 600) { @Override public boolean condition() { log("Wait for Fishing tut!"); RS2Widget FishingWidg = getWidgets().getWidgetContainingText(263, "Fishing"); return FishingWidg != null && FishingWidg.isVisible(); } }.sleep(); This was my second attempt - getTabs().open(Tab.INVENTORY); if(getTabs().isOpen(Tab.INVENTORY)) { new ConditionalSleep(15000, 600) { @Override public boolean condition() { log("Wait for Fishing tut!"); RS2Widget FishingWidg = getWidgets().getWidgetContainingText(263, "Fishing"); return FishingWidg != null && FishingWidg.isVisible(); } }.sleep(); } But still the same issue...? It's strange though because sometimes it works correctly & sometimes it doesn't..
  8. I didn't realise that whilst setting displayDisc it gives the current state of that widget, I thought it would live check the current state during usage... Thanks for your response & help :)
  9. For some reason my conditional sleep isn't working how I expect it too, it checks for a widget every 600ms for a 15 second period, but during the checks the widget is visible but goes undetected until it finishes the end of its current sleep, then onLoop obviously brings back the onconditional sleep function which then detects the widget instantly? Example of code - RS2Widget Displaydisc = getWidgets().getWidgetContainingText(162, "What name would you like to check"); new ConditionalSleep(15000, 600) { @Override public boolean condition() { log("Wait for display input!"); return Displaydisc != null && Displaydisc.isVisible(); } }.sleep(); Output from logger - [INFO][Bot #1][01/10 07:22:16 AM]: Wait for display input! [INFO][Bot #1][01/10 07:22:17 AM]: Wait for display input! [INFO][Bot #1][01/10 07:22:17 AM]: Wait for display input! [INFO][Bot #1][01/10 07:22:18 AM]: Wait for display input! [INFO][Bot #1][01/10 07:22:18 AM]: Wait for display input! [INFO][Bot #1][01/10 07:22:19 AM]: Wait for display input! [INFO][Bot #1][01/10 07:22:20 AM]: Wait for display input! [INFO][Bot #1][01/10 07:22:20 AM]: Wait for display input! [INFO][Bot #1][01/10 07:22:21 AM]: Wait for display input! [INFO][Bot #1][01/10 07:22:21 AM]: Wait for display input! [INFO][Bot #1][01/10 07:22:22 AM]: Wait for display input! [INFO][Bot #1][01/10 07:22:23 AM]: Wait for display input! [INFO][Bot #1][01/10 07:22:23 AM]: Wait for display input! [INFO][Bot #1][01/10 07:22:24 AM]: Wait for display input! [INFO][Bot #1][01/10 07:22:24 AM]: Wait for display input! [INFO][Bot #1][01/10 07:22:25 AM]: Wait for display input! [INFO][Bot #1][01/10 07:22:26 AM]: Wait for display input! [INFO][Bot #1][01/10 07:22:26 AM]: Wait for display input! [INFO][Bot #1][01/10 07:22:27 AM]: Wait for display input! [INFO][Bot #1][01/10 07:22:27 AM]: Wait for display input! [INFO][Bot #1][01/10 07:22:28 AM]: Wait for display input! [INFO][Bot #1][01/10 07:22:29 AM]: Wait for display input! [INFO][Bot #1][01/10 07:22:29 AM]: Wait for display input! [INFO][Bot #1][01/10 07:22:30 AM]: Wait for display input! [INFO][Bot #1][01/10 07:22:30 AM]: Wait for display input! [INFO][Bot #1][01/10 07:22:31 AM]: Wait for display input! [INFO][Bot #1][01/10 07:22:31 AM]: Display input found [INFO][Bot #1][01/10 07:22:32 AM]: Wait for display input! [INFO][Bot #1][01/10 07:22:32 AM]: Display input found As you can see from the logger after the 15 second period is sleep is over on the second loop it finds the Displaydisc instantly every time..
  10. I forgot to refresh my scripts in the selector ? Thanks for your time & help though :).
  11. import org.osbot.rs07.api.ui.RS2Widget; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import java.awt.*; @ScriptManifest(name = "ScriptTest", author = "Jar", version = 1.0, info = "", logo = "") public class ScriptTest extends Script { @Override public void onStart() { log("ScriptTest has started!"); } @Override public void onExit() { log("ScriptTest has ended!"); } @Override public int onLoop() { log("started loop"); return 100; //The amount of time in milliseconds before the loop starts over } @Override public void onPaint(Graphics2D g) { //This is where you will put your code for paint(s) } } I wasn't sure if I had to execute onLoop by calling it in onStart, but then every script I've seen doesn't do that, it just simply writes tasks within onLoop & they're executed simultaneously.
  12. Do you need VIP to run local scripts, because my scripts onLoop doesn't seem to execute? I can run the script, and the onStart log outputs, but the onLoop doesn't?
×
×
  • Create New...