Jump to content

Creating a simple kill/loot script


Definite

Recommended Posts

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
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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