Userfunctions and waypoints looking for a good home

Additional botting resources. Addons may be either for the game itself or for the RoM bot.
Forum rules
Only post additional bot resources here. Please do not ask unrelated questions.
Post Reply
Message
Author
imaginethat
Posts: 61
Joined: Sun Jul 10, 2011 10:39 pm

Userfunctions and waypoints looking for a good home

#1 Post by imaginethat » Mon Jun 11, 2012 10:54 pm

Hi
I have been playing around with the bot for a while now, and I was enjoying just learning Lua and getting the bot to get around by itself. I like AI and had ideas of creating a small bit of AI with this BOT. But I have kind of lost interest with it now, as I am really just scripting what the bot does, and if its not scripted it doesn't do it, so no real intelligents.
The one thing that has really bugged me, it the inability to get the bot to upgrade its own gear. I am not saying the bot cant do this, I just saying it is way beyond my ability and no one else has done it. I think you are getting close to something rock5?
So no matter how well I coded the bot, I would still need to "get it dressed in the morning" to deal with bigger mobs as it gains levels and heads to new areas to kill.

This forum has helped me heaps, and I just want to upload the work that I had done on the bot so other could pick through it to get any useful bits out of it.

There are many waypoint files, and one big userfunctions file containing all the functions I created. I'm sure it would be cleaner to split the functions out into more meaningful files, but it still works fine with it all in the one file.
The BOT starts at the human newbie area, and works its way through to Obsidian Stronghold. The "Travel.xml file has a path all the way, so that is a good default file to start the bot with if you are not sure where you are at.
If you are near a merchant I would start the bot with the todomerchant.xml file, as the merchant is the central point in any town, and will do everything from the merchant.
I do not pretend these function are perfect, but I have run at least a dozen bots through using it, as long as you manually upgrade the bots gear it works fine.
You will need your own way to manage the loot in your bag, to drop or not pick up crap. You will also need another character to send mail to, and you can set them at the top of the functions file. You will also need rock5 mail mod.
You will also need to add a couple of things into your profile, mainly “startup()”. Have a look at some of the examples I have in the attached folders.
The last thing I was working on was adding quests to the bot. I have added several daily quests. The Quests I started working on around Obsidian Stronghold, and the files work, and I had added checks into the functions file, but they do not quite call the appropriate files. I was thinking of having a quest file for each level, so when you hit level 42, the function checks to see if you have any lvl42 quests to do, if so questlinelvl42.xml will be called, and inside that xml file it will do some more onload checks to figure out how far through the quests you have gone and head to that NPC. I have created the (some) questline files, but they need to be integrated into the functions.
Have fun, and thanks all for your help.
Imaginethat
Attachments
rom.zip
(185.96 KiB) Downloaded 476 times

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

Re: Userfunctions and waypoints looking for a good home

#2 Post by rock5 » Tue Jun 12, 2012 12:08 am

Seems really interesting. Looks like a lot of work went into it. In the end I realy only want the bot to do certain tasks not to completely automate everything, which is what it looks like you were trying to do.

Still, everything is well documented and seems to be written well. It might be a worthwhile project for someone to continue if they are interrested in what it does.
  • 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

top1
Posts: 50
Joined: Mon Jan 03, 2011 4:57 pm

Re: Userfunctions and waypoints looking for a good home

#3 Post by top1 » Sat Jun 23, 2012 4:31 pm

this looks BRILLIANT!!!


But every 2nd userfunction is crashing because of some <nill values>
on the first start:
function CEquipItem:botEquipTooltip()
(Ive just disabled the function because I have NO IDEA where the error might be)
Next thing is in "customsettings" somewhere...



Is it possible to fix it without hours of time?
Does anyone what the probs might be?

I guess some changed pointers (doesnt even know if its possible to set static references) or other internal things?
So if someone could tell me WHAT I had to fix, I would be very thankful!

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

Re: Userfunctions and waypoints looking for a good home

#4 Post by rock5 » Sat Jun 23, 2012 11:42 pm

That's trying to add a function to an existing class ie. CEquipItem. I did some major remodeling of the item classes, a result of which CEquipItem has been renamed CEquipmentItem. Try changing any references to CEquipItem to CEquipmentItem. It also no longer exists at "inventory.EquipItems". They have their own container now, 'equipment'. I'm not sure what other classes he is trying to add to but if there are any references to CItem change them to CInventoryItem.

Having a look at the code it looks like addon_SRSwap.lua is where all the problems will be. I even see code errors that would never have worked. For instance one place CEquipItem:botEquipTooltip() is used is wrong

Code: Select all

	for i=1,22,1 do
		local eqslotitem = inventory.BagSlot[i];
		if not eqslotitem.Empty then
			equipItemInfo = eqslotitem:botEquipTooltip();
1 to 22 obviously is trying to refer to the equipment slots which were stored in inventory.EquipSlots but instead they get info from inventory.BagSlot which is the inventory slots.

I had a quick attempt at adjusting the file and fixing a few errors that were obvious. Try this. It's untested.
Attachments
addon_SRSwap.lua
(21.23 KiB) Downloaded 199 times
  • 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

top1
Posts: 50
Joined: Mon Jan 03, 2011 4:57 pm

Re: Userfunctions and waypoints looking for a good home

#5 Post by top1 » Tue Jun 26, 2012 8:34 am

Nice!
Thank you rock5.

The bot works nice, the first "check-up's"
Image


so here is the code snippet on which he fails:

Code: Select all

check Mana Potions --
		printf(" Mana Potions ");
			if (  customsettings.options.MANA_POTION_LOW > _TMpoti ) then
				cprintf(cli.red, "BAD!: %s", _TMpoti);
				if _plevel > 10 then
					cprintf(cli.red, ", setting waypoint type to Run. \n"); 
					Run();
					_gotorepair = true
				else 
					printf(". \n");
				end
			elseif ( _manalvl*15 > _TMpoti ) then
				cprintf(cli.yellow, "Low: %s \n", _TMpoti);
			elseif ( _manalvl*25 > _TMpoti ) then
				cprintf(cli.lightblue, "OK: %s \n", _TMpoti);
			elseif ( _manalvl*50 > _TMpoti ) then
				printf("OK: %s \n", _TMpoti);
			elseif ( _manalvl*75 > _TMpoti ) then
				cprintf(cli.green, "Good: %s \n", _TMpoti);
			else
				cprintf(cli.green, "Great: %s \n", _TMpoti);
			end;		

:?

customsettings.options.MANA_POTION_LOW == nil value?


no idea.... :(

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

Re: Userfunctions and waypoints looking for a good home

#6 Post by rock5 » Tue Jun 26, 2012 8:56 am

No, it's saying 'customsettings' is not a table but a nil value. customsettings is initialized in the 'Startup()' function. That function is called in the 'onLoad' of the profiles. So I'm guessing you are not using one of the custom profiles. If not I suggest having a look through them and adding any code you see in the events to your profile.
  • 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

top1
Posts: 50
Joined: Mon Jan 03, 2011 4:57 pm

Re: Userfunctions and waypoints looking for a good home

#7 Post by top1 » Tue Jun 26, 2012 12:25 pm

ok this worked great :) thx

UNTIL...

he was trying to use ipairs(zonequestlist) -- line 2026 in userfunctions
bad argument #1 <table expected, got nil>


zonequestlist is defined as:

Code: Select all

local zonequestlist = questlist[_zoneID];
in my case it should have been [ASLAN_VALLEY] which is an empty table

Code: Select all

[ASLAN_VALLEY]		= { [1] = {	qlevel = 20, questid = 123456, acceptnpc = "NPC", completenpc = "NPC", itemreward = 0, questname = "Name" },
								[2] = {	qlevel = 20, questid = 123456, acceptnpc = "NPC", completenpc = "NPC", itemreward = 0, questname = "Name" } },
[ASLAN_VALLEY] is again defined as 1004 --> ZONE ID

did the ZONE ID's change??
in some update?


EDIT:

It appears so I changed the ID to 2004 and now it works!!
Also I had to deactivate (set false)

Code: Select all

settings.profile.options.SWAP_CLASS = true -- Do you want the bot to swap class?
Got a lot of different compare number to nil values.
Next problem: If you got no gold with your bot he tries to buy things, walking away... and getting back to the vendor
to buy again... and again and again he is trying hard :)
Last edited by top1 on Tue Jun 26, 2012 12:46 pm, edited 1 time in total.

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

Re: Userfunctions and waypoints looking for a good home

#8 Post by rock5 » Tue Jun 26, 2012 12:45 pm

zone 4 = zone 4 channel 1
zone 1004 = zone 4 channel 2
zone 2004 = zone 4 channel 3

So, I'm sorry, you didn't fix anything. :)

The bot has a function 'getZoneId()' that returns the zone from memory and removes the channel bit. So maybe change

Code: Select all

local _zoneID = RoMScript("GetZoneID()")
to

Code: Select all

local _zoneID = getZoneId()
  • 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

Tamyra
Posts: 133
Joined: Tue Feb 01, 2011 6:09 pm

Re: Userfunctions and waypoints looking for a good home

#9 Post by Tamyra » Mon Jul 16, 2012 9:40 am

The way I have dealt with that problem in my code is to have pre-made twinked/character gear in the bot's bags, and at the points where I know the bot will be at a lvl to use the gear I will stick in

Code: Select all

inventory:useItem(220347); yrest(3000);
In this case the twinked out item of gear being a lvl 7 Short Robe

http://www.runesdatabase.com/item/220347

In most cases, every single item in game has an item ID that can be used for that purpose, or just to open bags...etc. You may also want to be sure you have your profile sell settings fixed so that any item with more than 3 stats stays in your bags when at a merchant even if your char cannot wear it yet.

You can probably make an if/then argument in the onload, if player lvl more than x variable then use item.

imaginethat
Posts: 61
Joined: Sun Jul 10, 2011 10:39 pm

Re: Userfunctions and waypoints looking for a good home

#10 Post by imaginethat » Sun Jul 22, 2012 6:09 pm

Hi all
just popped back in to see if there was any feedback on the functions/scripts etc.
I see over a hundred people have downloaded the files, is there anyone that has expanded on them?
Just curious at any direction that they have been taken in.

kilbord
Posts: 49
Joined: Fri Feb 24, 2012 11:27 am

Re: Userfunctions and waypoints looking for a good home

#11 Post by kilbord » Sun Oct 07, 2012 10:37 am

what are all these waypoints for to...

top1
Posts: 50
Joined: Mon Jan 03, 2011 4:57 pm

Re: Userfunctions and waypoints looking for a good home

#12 Post by top1 » Wed Oct 17, 2012 8:43 am

In case of leveling this is out-dated!

there are a bunch of other waypoints up to xaveria in the new zone which will get you 10 times faster to level 48 -> dogmeat butterfly quests

use those two:
http://www.solarstrike.net/phpBB3/viewt ... =27&t=2838
http://www.solarstrike.net/phpBB3/viewt ... =27&t=3743

Post Reply

Who is online

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