How could i start on this ? suggestion needed

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
Paton
Posts: 28
Joined: Fri Sep 03, 2010 12:23 pm

How could i start on this ? suggestion needed

#1 Post by Paton » Mon Sep 06, 2010 3:51 pm

Hello,
I am new to LUA and Micromacro, but have some years experience with botting in Ultima Online, Everquest 2.

I would like to try something unusual as my first project in ROM scripting and just need some help how to start it. Making up a waypoint file isnt that bad, but i want something different.

I am a kind of person, who wants to reduce mouse clicking ingame to almost zero, when playing a game actively, cause i am hardcore keyboard player.

Plans are to make a script, which does the following:
1. Loot corpse on keypress near the char.
2. Harvest on keypress near the char
3. and maybe extend this later to more

I would need to use functions from ROM Bot as i understand this, but i dont need any waypoints for this. So can i make an "empty waypoint" (no coordinates) file or how does the structure of the file has to be ?

or

do i need to take out the needed functions from ROM Bot and write my own .lua file for this ?

I would appreciate any idea how to start on this.

swietlowka
Posts: 316
Joined: Wed Jun 16, 2010 8:16 am

Re: How could i start on this ? suggestion needed

#2 Post by swietlowka » Tue Sep 07, 2010 2:29 am

im not sure but imo u could make it in a macro, no bot needed then

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: How could i start on this ? suggestion needed

#3 Post by rock5 » Tue Sep 07, 2010 11:27 pm

You could put all your code in the onLoad section of a waypoint file like my RBAssist.xml. Maybe you can even use that file as a basis for your code.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

Paton
Posts: 28
Joined: Fri Sep 03, 2010 12:23 pm

Re: How could i start on this ? suggestion needed

#4 Post by Paton » Thu Sep 09, 2010 5:39 am

rock5 wrote:You could put all your code in the onLoad section of a waypoint file like my RBAssist.xml. Maybe you can even use that file as a basis for your code.
Hello,
Ive checked RBAssist.xml and understand most of it. So the file has to look like
this:

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
	<onLoad>
mycode
	</onLoad>
</waypoints>
Where is that script RBTrigger, i didnt find anywhere ?
Do I need check for keyboard presses with LUA code ?
AND
I have access to player:harvest(). Is looting this here ?

Code: Select all

     player:loot();
If the player has a dead enemy target, it will attempt to loot the corpse. This is generally not needed by the end-user. 
Where is all that source code buried for player:harvest(), player:targetObject(), player:loot(), CObjectList(),... ? I didnt find it and the romwiki doesnt tell anything about parameters for player:loot() ?

sincerly,
Paton

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: How could i start on this ? suggestion needed

#5 Post by Administrator » Thu Sep 09, 2010 12:44 pm

Paton wrote: Do I need check for keyboard presses with LUA code ?
You do not have to, but you can if you want.
I have access to player:harvest(). Is looting this here ?

Code: Select all

     player:loot();
If the player has a dead enemy target, it will attempt to loot the corpse. This is generally not needed by the end-user. 
Yes, you can use player:harvest(). Yes, player:loot() will cause the player to loot, but do not include that second line (the description), as it isn't Lua code and will generate an error.
Where is all that source code buried for player:harvest(), player:targetObject(), player:loot(), CObjectList(),... ? I didnt find it and the romwiki doesnt tell anything about parameters for player:loot() ?
All player functions are in rom/classes/player.lua. You'll look for functions named CPlayer:<whatever>. CPlayer:loot() does not take any parameters. It just loots the selected target, and possibly picks up a sigil if one was dropped.

Paton
Posts: 28
Joined: Fri Sep 03, 2010 12:23 pm

Re: How could i start on this ? suggestion needed

#6 Post by Paton » Thu Sep 09, 2010 3:18 pm

@Administrator
thanks,
i do appreciate your answer. Ive overlooked player.lua in that directory, cause i was more focused on improving the speed of Rock5's Millers Ranch Scripts and learning my first steps there.

Ive found all i would need for the keyboard at http://www.solarstrike.net/wiki/index.p ... rd_Control, i think.

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
   <onLoad>
mycode
   </onLoad>
</waypoints>
Do i need a loop in mycode to check for keyboard presses or does all between <waypoints> and </waypoints> get executed in specific intervalls ? Ive seen that Rock5 is using a loop in RBAssist.xml, so i am unsure.


@Administrator

Code: Select all

while player:target_Object(112955,500) do -- Check for hens
It seems that setting the wait to 500-1000 causes client crashes. Any idea what could cause this ?

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: How could i start on this ? suggestion needed

#7 Post by Administrator » Fri Sep 10, 2010 1:15 pm

Do i need a loop in mycode to check for keyboard presses or does all between <waypoints> and </waypoints> get executed in specific intervalls ? Ive seen that Rock5 is using a loop in RBAssist.xml, so i am unsure.
Yes, you would run your code in a while loop there.
It seems that setting the wait to 500-1000 causes client crashes. Any idea what could cause this ?
No. If this is the case, it sounds like a problem with the client. Try reinstalling it.

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: How could i start on this ? suggestion needed

#8 Post by rock5 » Fri Sep 10, 2010 10:59 pm

I just noticed that not all your original questions were answered.
Paton wrote:Where is that script RBTrigger, i didnt find anywhere ?
In game you can set up a macro to send triggers to the script. The macro looks like this

Code: Select all

/script RBTrigger="go"
Pressing this macro will have different meanings depending on what mode you have the script set to, as described at the top of the RBAssist.xml script.

A note about classes: The 'player' object is created from the CPlayer class template which is found in the player.lua file. The 'inventory' object is created from the CInventory class template which is in the inventory.lua file. The 'objectList' object is created from the CObjectList class template which is in the objectlist.lua file. etc, etc. I hope that makes it clearer.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 2 guests