ATCP demo scripts
Re: ATCP demo scripts
that'll be the output of a display() function, I believe. For a table which is empty.
Re: ATCP demo scripts
Ah, I see now.
Now, I'm wondering why my tables are empty, instead of parsing nicely like is shown in Vadi's sample output?
Now, I'm wondering why my tables are empty, instead of parsing nicely like is shown in Vadi's sample output?
Re: ATCP demo scripts
CharVitals string would need to be changed for your MUD if it's not Achaea, because each IRE MUD uses a different formnat for the text. The rest, not sure - you'd need to check by doing display(whatever) at the different stages of the script to see where things are going wrong in your MUD.
Re: ATCP demo scripts
you may want to try a simple call to
display(atcp)
also, if you're using mudbot/lmts/a proxy of almost any time then ATCP may not be getting passed to mudlet.
display(atcp)
also, if you're using mudbot/lmts/a proxy of almost any time then ATCP may not be getting passed to mudlet.
Re: ATCP demo scripts
Alright, I figured out the ATCP parsing. (Thanks for the script, Vadi!) I'm trying to incorporate Vadi's autosipper with ATCP, especially for cases of recklessness, blackout, or when locked into an aethership module. This is what I have so far:
I know it's working through the parts where I echo as a check, since this is what I get as a screenshot:

Why is it not autosipping, though? Gar.
EDIT: Changed screenshot to show it actually failing to sip despite having currentmana being below sipmana.
Code: Select all
status = {}
function CharVitals(event, arg)
local r = rex.new( "NL:(\\d+)/100 H:(\\d+)/(\\d+) M:(\\d+)/(\\d+) E:(\\d+)/(\\d+) P:(\\d+)/(\\d+) N:(\\d+)/(\\d+) W:(\\d+)/(\\d+)" )
if r:match( arg ) then
status.next_level,
status.current_health, status.max_health,
status.current_mana, status.max_mana,
status.current_ego, status.max_ego,
status.current_power, status.max_power,
status.current_endurance, status.max_endurance,
status.current_willpower, status.max_willpower = r:match( arg )
end
siphealth = status.max_health*0.75
sipmana = status.max_mana*0.75
sipego = status.max_ego*0.75
berryhealth = status.max_health*0.50
berrymana = status.max_mana*0.50
currenthealth = status.current_health
currentmana = status.current_mana
currentego = status.current_ego
display(status)
echo("\nsiphealth = " .. siphealth)
echo("\nsipmana = " .. sipmana)
echo("\nsipego = " .. sipego)
echo("\nberryhealth = " .. berryhealth)
echo("\nberrymana = " .. berrymana)
echo("\ncurrenthealth = " .. currenthealth)
echo("\ncurrentmana = " .. currentmana)
echo("\ncurrentego = " .. currentego)
echo("\n\nhealbalance = " .. healbalance)
echo("\nberrybalance = " .. berrybalance)
if healbalance == 1 then
if currenthealth < siphealth then
send ("sip health")
healbalance = 0.5
elseif currentmana < sipmana then
send("sip mana")
healbalance = 0.5
elseif currentego < sipego then
send("sip bromides")
healbalance = 0.5
end
elseif healbalance == 1 then
if currentmana < sipmana then
send ("sip mana")
healbalance = 0.5
elseif currentego < sipego then
send ("sip ego")
healbalance = 0.5
elseif currenthealth < siphealth then
send ("sip health")
healbalance = 0.5
end
elseif healbalance == 1 then
if currentego < sipego then
send ("sip mana")
healbalance = 0.5
elseif currenthealth < siphealth then
send ("sip ego")
healbalance = 0.5
elseif currentmana < sipmana then
send ("sip health")
healbalance = 0.5
end
end
if berrybalance == 1 and (currenthealth < berryhealth or currentmana < berrymana) then
send ("outr sparkleberry")
send ("eat sparkleberry")
berrybalance = 0.5
end
end

Why is it not autosipping, though? Gar.
EDIT: Changed screenshot to show it actually failing to sip despite having currentmana being below sipmana.
Last edited by Ilithyia on Fri Mar 19, 2010 7:32 pm, edited 1 time in total.
Re: ATCP demo scripts
In your screenshot, it shouldn't need to - currenthealth is above siphealth.
Re: ATCP demo scripts
Oh, the screenshot isn't capturing the part where the script failed to autosip. Later, I tried influencing a mob until my ego got below sipego and it failed to do anything. Despite the spam, I left the echos and display(status) up just to make sure that the variables and tables were updating timely and correctly, and they were. It just wasn't sipping.
Re: ATCP demo scripts
you have a variable for sip balance, yes? Do you have triggers to set balance on and off? Did you initialize the balances?
Re: ATCP demo scripts
Yeah, here's a screenshot of my sip balance triggers:

And here's my test to make sure it's working:


And here's my test to make sure it's working:

Re: ATCP demo scripts
I think you're missing an if:
Between the two bolded lines, could be your indenting just has me confused but that might be it.
If that doesn't work, what do the error and debug consoles have to say?
Code: Select all
if healbalance == 1 then[b]
if currenthealth < siphealth then
send ("sip health")[/b]
healbalance = 0.5
elseif currentmana < sipmana then
send("sip mana")
healbalance = 0.5
elseif currentego < sipego then
send("sip bromides")
healbalance = 0.5
end
elseif healbalance == 1 then
if currentmana < sipmana then
send ("sip mana")
healbalance = 0.5
elseif currentego < sipego then
send ("sip ego")
healbalance = 0.5
elseif currenthealth < siphealth then
send ("sip health")
healbalance = 0.5
end
elseif healbalance == 1 then
if currentego < sipego then
send ("sip mana")
healbalance = 0.5
elseif currenthealth < siphealth then
send ("sip ego")
healbalance = 0.5
elseif currentmana < sipmana then
send ("sip health")
healbalance = 0.5
end
end
If that doesn't work, what do the error and debug consoles have to say?