Jump to content

Czar

Global Moderator
  • Posts

    21826
  • Joined

  • Last visited

  • Days Won

    1925
  • Feedback

    100%

Everything posted by Czar

  1. Czar

    OSBot name

    getBot().getUsername(); Maybe, I haven't checked
  2. gjdm, but what was the interface update? was it the one I talked about earlier about the lines and stuff?
  3. Czar

    CzarRangingGuild

    Ah unlucky, which other scripts did you use?
  4. If you need any more help just pm @OP remove the client. So its just this.getInventory() because in osbot2 they changed it around. Client. Is just for old osbot.
  5. Did somebody say... Counter strike? 1v1 me pls
  6. If inventory isn't full, drop? Remember to remove the ! before the boolean (it was !isEmpty now !isFull) they are opposite so it should be if (getInventory().isFull()) Or is the isFull causing an actual error?
  7. 1) Don't generate jar files while testing a script, you should do that in the end, otherwise you must restart etc. What I do, is just make your project folder on Users/OSBot, and change your output folder to OSBot/scripts, so all the .class goes there and you can just save script on your ide, and refresh scripts on OSBot and you don't have to restart client every time you make an update 2) A trade request is a message, so you must add a messagelistener to your script by doing the following; put this in your onStart method: getBot().addMessageListener(this); and then add the overriden method onMessage(Message m) the message will be String msg = m.getMessage(); and to check if its a trade, just do m.getMessageType(), which is an enum and contains RECEIVE_TRADE (in your case) As for the last question I've never handled trading in a script so I'm unable to assist you there, but there's an open source merching bot (which handles trades) in the snippet section iirc.
  8. public NPC getTarget(final String npc) { return getNpcs().closest(new Filter<NPC>() { public boolean match(NPC n) { if (!n.getName().equalsIgnoreCase(npc)) { return false; } if (n.getInteracting() != null) { return false; } return true; } }); } You can use a Filter<> to to find the best npc, in this case it's the npc which isn't interacting with anything, and is called whatever you put in the getTarget method, so: NPC guard = getTarget("Guard"); if (guard != null) { // attack } And it will attack every NPC with the name 'guard', also, try to use names instead of IDs when it comes to npcs and objects, since the IDs can change from time to time. You can greatly expand on the filter by adding more stuff like getMap().canReach for extra failsafes etc. As for the camera movement, the while() is unnecessary because you are already checking if its visible.
  9. Czar

    Disabling anti ban

    EDIT: Thought he meant for other scripts.
  10. Damn nice, but does it run OSBot?
  11. Mine: Called Sleep Sleep Sleep Sleep Sleep Sleep Sleep Sleep Sleep Sleep Sleep Sleep Sleep Sleep Sleep Sleep Sleep Sleep Sleep Sleep Sleep public boolean contains(int i) { System.out.println("Called"); return true; } public void check() { if (contains(0)) { for (int i = 0; i < 100; i++) { System.out.println("Sleep"); } } } Yours Called Sleep Called Sleep Called Sleep Sleep Called Sleep Called Sleep Called Sleep Called Sleep Called Sleep Called Sleep Called Sleep Called Sleep Sleep Called public boolean contains(int i) { System.out.println("Called"); return true; } public void check() { for (int i = 0; i < 100 && contains(0); i++) { System.out.println("Sleep"); } } Hypothetical, but yeah.
  12. Dude it's not the same thing, you just confused me.. if (getInventory().contains(uncut)){ for(int i = 0; i < 100; i++) { sleep(50); } } That is calling inventory.contains 1 time, the code you have calls it 100 times. Try it..
  13. http://osbot.org/api/org/osbot/rs07/utility/ConditionalSleep.html Use conditional sleep until inventory is empty
  14. Lol my bad, I read it wrong, well IDK what else to say, just find another way to sleep after depositing items, it's really not a big issue
  15. if (getInventory().contains(uncut)){ for(int i = 0; i < 100; i++) { sleep(50); } } Idk, try that
  16. Ohh I understand, the best way to do this is returning 50 on the onLoop method, because it will re-loop after 50ms until the action is done.
  17. You are calling that method 100 times, so it's 50 * 100 ms, just do getAmount if you want to get the amount of uncuts
  18. CzarRangeGuild is a good script imo :P
  19. Update 1.1 will feature a total re-write, as I am improving my library's combat code.
  20. Czar

    CzarRangingGuild

    What's the problem? It seems to be running fine for everybody else.
  21. CzarRangeGuild has yet to reach 2 account bans :P
×
×
  • Create New...