Jump to content

Creating a simple kill/loot script


Recommended Posts

Posted (edited)

Hey..

        I am a complete noob at scripting and want to create a simple kill & loot certain item script. Can anyone help. I have seen http://osbot.org/forum/topic/58775-a-beginners-guide-to-writing-osbot-scripts-where-to-get-started-by-apaec/ .

       Is there any way I can use that skeleton to integrate a kill / loot script? Or can anyone point me in the right direction for how to start such a script? 

 

 

Edited by Definite
  • Like 1
Posted

to kill:

NPC enemy = npcs.closest("exact npc name goes here");if (enemy != null && enemy.exists()) {    enemy.interact("Attack");}
To loot:
GroundItem g = groundItems.closest("exact item name here");if (g != null && g.exists()) {    g.interact("Take");}
apa
Wow that is simple. Is there a food support, take from Bank and eat. All foods, cannon use option, wall from Bank to location. Also about the gui to show gains xp/hr. Time run, item gained.
Posted (edited)

Wow that is simple. Is there a food support, take from Bank and eat. All foods, cannon use option, wall from Bank to location. Also about the gui to show gains xp/hr. Time run, item gained.

You can definitely do all of those things, but it's a learning curve. You should familiarise yourself with the API which is, in essence, a list of OSBot's built in functions so that you don't have to create them yourself. You can find the API here.

 

The xp/hr, time run and items gained etc tracker is all part of what is called the 'paint'. If you want to learn to create a paint, I highly suggest the tutorial that was written by Pug. It can be found here. That will run you through how to do most of what you want to know for that part.

 

As for the others, there are built in functions for most of it that you can use. I would love to be more helpful but I'm still very much learning myself, however, if you have any general questions I'm always happy to do what I can to lend a hand.

 

My advise on how to begin would be start by creating a script that attacks Men and loots their bones/drops of your choice. That's a fairly simple script that would be manageable for anyone beginning to learn I believe and removes the complexities of eating and similar. As you begin to feel more comfortable, just add new elements such as eating and change the target NPC from Men to something like Lessor Demons (anything that can't immediately kill you if there's an error with the script).

Edited by omni4life
Posted

Wow that is simple. Is there a food support, take from Bank and eat. All foods, cannon use option, wall from Bank to location. Also about the gui to show gains xp/hr. Time run, item gained.

 

You can do anything if you code it. Literally everything you just stated is really easy to do, it's just making sure it doesn't run into any issues along the way, that's the hard part.

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...