local inc = math.ceil(#nameTable/4)
for i = 1, inc do
local val1 = nameTable[i]
local val2 = nameTable[i + inc]
local val3 = nameTable[i + inc*2]
local val4 = nameTable[i + inc*3]
if( not val1 ) then val1 = "" else val1 = i..": "..val1 end
if( not val2 ) then val2 = "" else val2 = i+inc..": "..val2 end
if( not val3 ) then val3 = "" else val3 = i+inc*2..": "..val3 end
if( not val4 ) then val4 = "" else val4 = i+inc*3..": "..val4 end
printf("[%s]\t[%s]\t[%s]\t[%s]\n",val1, val2, val3, val4)
end
local inc = math.ceil(#nameTable/4)
for i = 1, inc do
local val1 = nameTable[i]
local val2 = nameTable[i + inc]
local val3 = nameTable[i + inc*2]
local val4 = nameTable[i + inc*3]
if( not val1 ) then val1 = "" else val1 = i..": "..val1 end
if( not val2 ) then val2 = "" else val2 = i+inc..": "..val2 end
if( not val3 ) then val3 = "" else val3 = i+inc*2..": "..val3 end
if( not val4 ) then val4 = "" else val4 = i+inc*3..": "..val4 end
printf("[%s]\t[%s]\t[%s]\t[%s]\n",val1, val2, val3, val4)
end
getting /micromacro/scripts/rom/classes/waypointlist.lua:83: Failed to compile and run Lua code for waypointlist onLoad event. not sure why
Unless you show use the whole onload we wont be able to help you. Or use the lua file trick. Move your whole onload (minus the <onload> and </onload> tags) into a temporary lua file, eg. temp.lua, and put it in the waypoints folder. Then in the onload, include that file.
<?xml version="1.0" encoding="utf-8"?><waypoints type="TRAVEL">
<onLoad>
-- Buy Belts script - V2.0 - written by Jandrana
-- Edited by Eggman1414
<!-- Name Table is where you list all characters you want to send belts too -->
nameTable =
{
"Names are here"
};
local inc = math.ceil(#nameTable/4)
for i = 1, inc do
local val1 = nameTable[i]
local val2 = nameTable[i + inc]
local val3 = nameTable[i + inc*2]
local val4 = nameTable[i + inc*3]
if( not val1 ) then val1 = "" else val1 = i..": "..val1 end
if( not val2 ) then val2 = "" else val2 = i+inc..": "..val2 end
if( not val3 ) then val3 = "" else val3 = i+inc*2..": "..val3 end
if( not val4 ) then val4 = "" else val4 = i+inc*3..": "..val4 end
printf("[%s]\t[%s]\t[%s]\t[%s]\n",val1, val2, val3, val4)
end
</onLoad>
The problem is the concatenation characters after the *2 and *3 making an invalid number "2.." and "3.." so adding some extra spaces makes it work fine.
<?xml version="1.0" encoding="utf-8"?><waypoints type="TRAVEL">
<onLoad>
-- Buy Belts script - V2.0 - written by Jandrana
-- Edited by Eggman1414
<!-- Name Table is where you list all characters you want to send belts too -->
nameTable =
{
"Names are here"
};
local inc = math.ceil(#nameTable/4)
for i = 1, inc do
local val1 = nameTable[i]
local val2 = nameTable[i + inc]
local val3 = nameTable[i + inc*2]
local val4 = nameTable[i + inc*3]
if( not val1 ) then val1 = "" else val1 = i .. ": " .. val1 end
if( not val2 ) then val2 = "" else val2 = i+inc .. ": " .. val2 end
if( not val3 ) then val3 = "" else val3 = i+inc*2 .. ": " .. val3 end
if( not val4 ) then val4 = "" else val4 = i+inc*3 .. ": " .. val4 end
printf("[%s]\t[%s]\t[%s]\t[%s]\n",val1, val2, val3, val4)
end
</onLoad>
print("Did the Client Crash?")
print("1. Yes 2. No")
crash = io.stdin:read();
crash = tonumber(crash);
while crash == 1 do
print("Did the client crash while going to the mailbox?")
print("1. Yes 2. No")
mailcrash = io.stdin:read();
mailcrash = tonumber(mailcrash);
if mailcrash == 1 then break end
print("Did the client crash while going to the shop?")
print("1. Yes 2. No")
shopcrash = io.stdin:read();
shopcrash = tonumber(shopcrash);
if shopcrash == 1 then break end
print("Did the client crash while sending mail?")
print("1. Yes 2. No")
sendcrash = io.stdin:read();
sendcrash = tonumber(sendcrash);
if sendcrash == 1 then break end
end
if mailcrash == 1 then __WPL:setWaypointIndex(__WPL:findWaypointTag("To_Mailbox"))
elseif shopcrash == 1 then __WPL:setWaypointIndex(__WPL:findWaypointTag("To_Shop"))
elseif sendcrash == 1 then __WPL:setWaypointIndex(33)
end
So when the client crashes going to the shop it will do this: __WPL:setWaypointIndex(__WPL:findWaypointTag("To_Shop"))
There is no built in way to do that. You would have to create your own "find nearest waypoint" function that only includes the range of waypoints you want to include. You know, that might be worth adding to the bot. I could add an optional waypoint range to __WPL:getNearestWaypoint function, eg. __WPL:getNearestWaypoint(X, Z, Y, start_range, end_range). You could then use tags as welll like this,
I'm guessing he made no mention that different servers have different shop item ids. It clearly states at the top of the userfunction file and the userfunction topic page,
-- WARNING! GUIDs are unique per server. GUIDs given by other users might be wrong for your
-- server. So it's important to get your own GUIDs using the instructions below.
Try following the instructions at the top of the BuyFromItemShop userfunction file or topic page to get the correct GUID for your server.
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.