Page 1 of 1

How could i start on this ? suggestion needed

Posted: Mon Sep 06, 2010 3:51 pm
by Paton
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.

Re: How could i start on this ? suggestion needed

Posted: Tue Sep 07, 2010 2:29 am
by swietlowka
im not sure but imo u could make it in a macro, no bot needed then

Re: How could i start on this ? suggestion needed

Posted: Tue Sep 07, 2010 11:27 pm
by rock5
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.

Re: How could i start on this ? suggestion needed

Posted: Thu Sep 09, 2010 5:39 am
by Paton
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

Re: How could i start on this ? suggestion needed

Posted: Thu Sep 09, 2010 12:44 pm
by Administrator
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.

Re: How could i start on this ? suggestion needed

Posted: Thu Sep 09, 2010 3:18 pm
by Paton
@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 ?

Re: How could i start on this ? suggestion needed

Posted: Fri Sep 10, 2010 1:15 pm
by Administrator
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.

Re: How could i start on this ? suggestion needed

Posted: Fri Sep 10, 2010 10:59 pm
by rock5
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.