Jump to content

Spells


y2k

Recommended Posts

Hello All!

I am new to scripting and just want to learn how to use OSbot for odd jobs(E.G. collecting explosive potions from the dig site).

So my first script is a simple farming script. iIt can teleport to all five sites, it can collect the herbs and note them, plant herbs seeds, rake weeds and drops them if the bot is slow at planting the seeds and then logs out for set time.

The problem I am currently facing is that I want it to be able to run unlimited times E.G. leave it for a week( around 500 seeds planted per week) and not have to check up on the bot. To do this i would need to use the Lunar spell "Fertile soil" but I can't find how to use lunar spells in the api (yes all the teleports are using inventory methods to teleport).

Anyways thanks for reading, and hoping for some helpful responses.

Link to comment
Share on other sites

Hello All!

I am new to scripting and just want to learn how to use OSbot for odd jobs(E.G. collecting explosive potions from the dig site).

So my first script is a simple farming script. iIt can teleport to all five sites, it can collect the herbs and note them, plant herbs seeds, rake weeds and drops them if the bot is slow at planting the seeds and then logs out for set time.

The problem I am currently facing is that I want it to be able to run unlimited times E.G. leave it for a week( around 500 seeds planted per week) and not have to check up on the bot. To do this i would need to use the Lunar spell "Fertile soil" but I can't find how to use lunar spells in the api (yes all the teleports are using inventory methods to teleport).

Anyways thanks for reading, and hoping for some helpful responses.

 

The Spell enum does not include any non-standard spellbook spells.

You'll have to grab the spell's interface child and interact with it.

 

http://osbot.org/api/org/osbot/rs07/api/ui/RS2InterfaceChild.html

Edited by Botrepreneur
  • Like 1
Link to comment
Share on other sites

So.... i have to kidnap fertile soil's child. Just kidding.

Hahaha, I dont exactly know supposed to do with the child of a spell, but i did fix the problem i just set the mouse to move to the magic icon click it then move to the spot where fertile soil is and then interact with the herb patch. 

Im a super noob at scripting and it does everything on very very very basic level.

 

Thanks though! The more i script the more confused I get, maybe its time to get some fresh air. 

 

 

 

EDIT: okay so it looks waay too bot-like. How would I interact with the spell? I got P430 and C7 for Im guessing parent and child.

 

interact(java.lang.String... actions)
Executes an @link org.osbot.rs07.event.InteractionEvent which attempts to interact with this Interactable with the specified actions (if any).
 
Should i be using this?
 
 

 

 

 

Edited by y2k
Link to comment
Share on other sites

"A simple script that farms at all five patches and can run for weeks at a time". You have a lot of ambition but I think for your first script, you should start with something MUCH easier. Farming is actually quite hard (to at least get it right). It seems you are also unfamiliar with the API and how RS botting works (this bot works similar to a few other bots in the terms of general mechanics).

 

You should start small, for instance your explosive potion collector. 

 

Despite my strong recommendation, is correct. You would use the child interface of the Magic tab. I was considering adding Lunar's and Ancients, however I'd have to do an analysis of how many scripts would break as a result of it.

Link to comment
Share on other sites

"A simple script that farms at all five patches and can run for weeks at a time". You have a lot of ambition but I think for your first script, you should start with something MUCH easier. Farming is actually quite hard (to at least get it right). It seems you are also unfamiliar with the API and how RS botting works (this bot works similar to a few other bots in the terms of general mechanics).

 

You should start small, for instance your explosive potion collector. 

 

Despite my strong recommendation, is correct. You would use the child interface of the Magic tab. I was considering adding Lunar's and Ancients, however I'd have to do an analysis of how many scripts would break as a result of it.

 

Correct. I don't exactly what I'm doing. I started with it walking to the digsite, worked well. just had some tabs and seeds in my inventory and tested if i get it to click on them, worked well. Then I wanted to practice interacting between inventory and objects outside of the inventory. then tried to use the seeds on herb patches. and steadily grew from there. But since I'm so close to finishing it I skipped ahead and asked for a bit of help.

 

 

I'd like to learn about interacting with objects that are not in the data base. So the child is the number that comes after the c in the interface debug and the parent is the number after the P (I had P430 c2)?  so how do I interact with the child if it is a spell?

 

EDIT: I was wondering why the standard spells were in the api but ancients and lunars were nowhere to be found. I thought you could just add the extra spells to the class, but i probably know nothing about it lol

Edited by y2k
Link to comment
Share on other sites

Correct. I don't exactly what I'm doing. I started with it walking to the digsite, worked well. just had some tabs and seeds in my inventory and tested if i get it to click on them, worked well. Then I wanted to practice interacting between inventory and objects outside of the inventory. then tried to use the seeds on herb patches. and steadily grew from there. But since I'm so close to finishing it I skipped ahead and asked for a bit of help.

 

 

I'd like to learn about interacting with objects that are not in the data base. So the child is the number that comes after the c in the interface debug and the parent is the number after the P (I had P430 c2)?  so how do I interact with the child if it is a spell?

 

EDIT: I was wondering why the standard spells were in the api but ancients and lunars were nowhere to be found. I thought you could just add the extra spells to the class, but i probably know nothing about it lol

 

Adding two new entire Spell books are not that simple as it seems , it requires a lot more data collection and analysis happy.png

 

As for interacting with Parent/Child values, you can do this by grabbing the interface and selecting the interaction string: 

interfaces.get(PARENT_ID).getChild(CHILD_ID).interact("ACTION HERE");

Of course the values will need to be substituted for the appropriate values. However, make sure you check if the interface is visible first, interacting with a Spell for example whilst having your inventory open will give you NPE's. Just a thought happy.png

Link to comment
Share on other sites

Adding two new entire Spell books are not that simple as it seems happy.png

 

As for interacting with Parent/Child values, you can do this by grabbing the interface and selecting the interaction string: 

interfaces.get(PARENT_ID).getChild(CHILD_ID).interact("ACTION HERE");

Of course the values will need to be substituted for the appropriate values. However, make sure you check if the interface is visible first, interacting with a Spell for example whilst having your inventory open will give you NPE's. Just a thought happy.png

 

Thanks! One reason this is so hard. I put the .interaction() before the .get(parent).getChild(child). Okay thanks I'll put in a check if spell is castable and i think that should be a good fail safe for both so it doesnt get stuck. Thanks Alek Divinty and Botrepreneur.

After this I'll stick to writing simpler scripts until i learn more. 

Link to comment
Share on other sites

"A simple script that farms at all five patches and can run for weeks at a time". You have a lot of ambition but I think for your first script, you should start with something MUCH easier. Farming is actually quite hard (to at least get it right). It seems you are also unfamiliar with the API and how RS botting works (this bot works similar to a few other bots in the terms of general mechanics).

 

You should start small, for instance your explosive potion collector. 

 

Despite my strong recommendation, is correct. You would use the child interface of the Magic tab. I was considering adding Lunar's and Ancients, however I'd have to do an analysis of how many scripts would break as a result of it.

You really should, if you need any I got the acient spell unlocked in my account
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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