-
Bill D Cat
- Posts: 555
- Joined: Sat Aug 10, 2013 8:13 pm
- Location: Deep in the Heart of Texas
#61
Post
by Bill D Cat » Thu Dec 26, 2013 12:56 am
Eggman1414 wrote:Does anyone know how to get a table to print each entry with an index number next to it using columns?
Perhaps using something like this?
Code: Select all
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
-
Eggman1414
- Posts: 111
- Joined: Sun Jun 17, 2012 2:27 pm
#62
Post
by Eggman1414 » Thu Dec 26, 2013 2:00 am
I keep getting this error.
/micromacro/scripts/rom/classes/waypointlist.lua:83: Failed to compile and run Lua code for waypointlist onLoad event.
Also Rock, yes the fusion part did fail:
IGF:\FusionFrame1:Show()\ [string "local a={FusionFrame1:Show()} return
a"]:1: attempt to index global 'FusionFrame1' (a nil value)
-
rock5
- Posts: 12173
- Joined: Tue Jan 05, 2010 3:30 am
- Location: Australia
#63
Post
by rock5 » Thu Dec 26, 2013 5:54 am
Ok, so I need to update it. I'll get on it.
- 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.”
-
Eggman1414
- Posts: 111
- Joined: Sun Jun 17, 2012 2:27 pm
#64
Post
by Eggman1414 » Fri Dec 27, 2013 12:05 am
Bill D Cat wrote:Eggman1414 wrote:Does anyone know how to get a table to print each entry with an index number next to it using columns?
Perhaps using something like this?
Code: Select all
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
-
rock5
- Posts: 12173
- Joined: Tue Jan 05, 2010 3:30 am
- Location: Australia
#65
Post
by rock5 » Fri Dec 27, 2013 12:50 am
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.
Code: Select all
<onload>
include("waypoints/temp.lua")
</onload>
What this will do is give you a better error description and line number. When you fix the error you can copy and paste it back into the onload.
- 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.”
-
Eggman1414
- Posts: 111
- Joined: Sun Jun 17, 2012 2:27 pm
#66
Post
by Eggman1414 » Fri Dec 27, 2013 2:20 am
Code: Select all
<?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>
-
Bill D Cat
- Posts: 555
- Joined: Sat Aug 10, 2013 8:13 pm
- Location: Deep in the Heart of Texas
#67
Post
by Bill D Cat » Fri Dec 27, 2013 2:43 am
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.
Code: Select all
<?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>
-
Eggman1414
- Posts: 111
- Joined: Sun Jun 17, 2012 2:27 pm
#69
Post
by Eggman1414 » Fri Dec 27, 2013 5:44 am
is there a way for the bot to choose the closest waypoint under a tag?
For example:
I have set up a crash option for my waypoint:
Code: Select all
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"))
Code: Select all
<!-- # 34 --><waypoint x="-17885" z="-3342" y="803" tag = "To_Shop">
</waypoint>
<!-- # 35 --><waypoint x="-17944" z="-3368" y="817"> </waypoint>
<!-- # 36 --><waypoint x="-18015" z="-3386" y="803"> </waypoint>
<!-- # 37 --><waypoint x="-18092" z="-3420" y="795"> </waypoint>
<!-- # 38 --><waypoint x="-18169" z="-3454" y="792"> </waypoint>
<!-- # 39 --><waypoint x="-18265" z="-3496" y="784"> </waypoint>
<!-- # 40 --><waypoint x="-18345" z="-3532" y="777"> </waypoint>
<!-- # 41 --><waypoint x="-18429" z="-3569" y="784"> </waypoint>
<!-- # 42 --><waypoint x="-18488" z="-3617" y="785"> </waypoint>
<!-- # 43 --><waypoint x="-18535" z="-3701" y="777"> </waypoint>
<!-- # 44 --><waypoint x="-18579" z="-3779" y="763"> </waypoint>
<!-- # 45 --><waypoint x="-18634" z="-3859" y="741"> </waypoint>
<!-- # 46 --><waypoint x="-18664" z="-3871" y="741"> </waypoint>
<!-- # 47 --><waypoint x="-18810" z="-3942" y="682"> </waypoint>
<!-- # 48 --><waypoint x="-18875" z="-3940" y="666"> </waypoint>
If the player is at 40 when the client crashed, it sets it to 34. How do I make it start around 40 instead of at the beginning?
-
rock5
- Posts: 12173
- Joined: Tue Jan 05, 2010 3:30 am
- Location: Australia
#70
Post
by rock5 » Fri Dec 27, 2013 6:33 am
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,
Code: Select all
elseif shopcrash == 1 then
start_range = __WPL:findWaypointTag("To_Shop")
end_Range = __WPL:findWaypointTag("At_Shop") -- Assuming such a tag existed
__WPL:setWaypointIndex(__WPL:getNearestWaypoint(player.X, player.Z, player.Y, start_range, end_range))
What do you think?
- 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.”
-
rock5
- Posts: 12173
- Joined: Tue Jan 05, 2010 3:30 am
- Location: Australia
#71
Post
by rock5 » Fri Dec 27, 2013 6:42 am
Try this version of waypointlist.lua. Then you will be able to do like the example above.
Let me know how it goes.
- 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.”
-
Eggman1414
- Posts: 111
- Joined: Sun Jun 17, 2012 2:27 pm
#73
Post
by Eggman1414 » Sat Dec 28, 2013 1:40 am
Quick question:
Do I have to have all of this or does your takemail() repeat until all mail is gone and deleted?
Code: Select all
UMM_TakeMail();
yrest(1000);
UMM_TakeMail():
yrest(1000);
Fusion_MakeMaxManaStones();
yrest(1000);
RoMScript("UMMFrame:Hide()")
player:target_Object ("Mailbox")
yrest(1000);
SendStones()
RoMScript("UMMFrame:Hide()")
yrest(1000);
Or can it just be:
Code: Select all
UMM_TakeMail();
Fusion_MakeMaxManaStones();
RoMScript("UMMFrame:Hide()");
yrest(1000);
SendStones();
yrest(1000);
-
rock5
- Posts: 12173
- Joined: Tue Jan 05, 2010 3:30 am
- Location: Australia
#74
Post
by rock5 » Sat Dec 28, 2013 3:40 am
No it doesn't. You could check the mail count, eg.
Code: Select all
repeat
local mailcount = RoMScript("UMMMailManager.MailCount")
UMM_TakeMail();
yrest(1000);
until 30 > mailcount or inventory:itemTotalCount(0) == 0
Although, you might want to add the make stones and send functions in that loop to make more room in the bag after each takemail. That's up to you.
- 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.”
-
Eggman1414
- Posts: 111
- Joined: Sun Jun 17, 2012 2:27 pm
#75
Post
by Eggman1414 » Sat Dec 28, 2013 4:01 am
Thanks, still trying to get this stupid fusion addon to work. I'll test that repeat function right now thanks
-
rock5
- Posts: 12173
- Joined: Tue Jan 05, 2010 3:30 am
- Location: Australia
#77
Post
by rock5 » Sun Dec 29, 2013 8:55 am
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.
- How to: copy and paste in micromacro
________________________
Quote:
- “They say hard work never hurt anybody, but I figure, why take the chance.”
Who is online
Users browsing this forum: Google [Bot] and 5 guests