Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • need some help on a script


    DontGetBanned

    Recommended Posts

    Posted

    i tend to be chasing my tail with scripting. just ANOTHER person trying to make a cow script/looting script

    1 problem fixed, runs as intended and to my liking, then a new problem within a different section of script will bug or not even run properly like it did before with the first problem.

    im having problems now with getting the scripts to sleep when it needs to!

    if i can get some sample codes to work with or the exact codes i need to make this properly work... ill just plug in my areas/items/anything i need to make the code function.

     

    Problem: -ATTACKING

    i will attack something, but it wont wait for ground items to show up then runs off attacking next NPC, then comes back to loot midcombat....EVERYTIME

    so i even have the State for looting but it usually always stays under the "attacking state" so it never usually spends time looting.

     

    Problem 2: -LOOTING

    when i try to loot the ground it goes, but it wont sleep until item is in the inventory. instead clicks on another item somewhere else and it will click back and forth between the 2 items and the player will just kinda go back and forth between the 2 items until it finally reaches a item to loot.

    i need to get these resolved so my script stops acting so bot-like.

    because i cant seem to get the states to switch from attacking i have 2 separate scripts which would ideally be better to combine into 1 but i need to get the attacking to stop, THEN loot all items i want, then ATTACK next npc, and if theres more items popping up, it will prioritize the looting over attacking.

    sometimes the script will try to loot with rightclicking and there is no item, i have a NULL check in place but it will do this about 5 times over before it realizes its not there.

     

    im also aware there is 3 ways to code, the oldschool way which makes the onLoop insanely long with a bunch of methods, and the States + onLoop, and i havnt tried it yet but there is another way which does tasks instead, and  you priortize the 1 thing over the others. such as you can make looting top priority then attacking, then banking.

     

    any help is appreciated.

     

    State-Gather.txt

    Posted

    also the file uploaded, is for the Problem 2.

     

    Problem 1 is that it attacks and keeps attacking but wont stop to loot, and this is in a different script which the state would be "attacking"

    but the getState() method could be coded wrong to trigger the "looting" state. 

    it did trigger once today but it was near an already full inventory... but havnt been able to trigger the state sense. hense im chasing 1 problem to another problem.

    Posted

    1. Implement a dynamic sleep that registers when Interacting entity hits 0 hp, and waits until there is ground items within X tiles. 

     

    2. Again, dynamic sleep. Before Interacting with ground item cache inventory item count, click item, sleep until inv count has increased. 

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.