Vadi Sipper for Achaea
Re: Vadi Sipper for Achaea
Thanks! These scripts are excellent learning tools.
Re: Vadi Sipper for Achaea
Hehe yup, that's why I changed it into a script that could me made to run on a login trigger. Come to think if it, I could make it part of the 'CharName' event handler, since that only runs at login.Vadi wrote:Hm... actually before you're even connected and right after mudlet starts
Re: Vadi Sipper for Achaea
That's generally a good idea as ATCP related events cannot be faked by other players.
Re: Vadi Sipper for Achaea
I've put it in, and it sips. Problem is, I can't see the changes with tracking on. Is there something wrong with how I pasted?
Code: Select all
function CharVitals(event, arg)
local r = rex.new( "H:(\\d+)/(\\d+) M:(\\d+)/(\\d+) E:(\\d+)/(\\d+) W:(\\d+)/(\\d+) NL:(\\d+)/(\\d+) " )
if r:match( arg ) then
if sipper.tracking == 1 then
sipper.prev_health = status.current_health
sipper.prev_mana = status.current_mana
end
status.current_health, status.max_health,
status.current_mana, status.max_mana,
status.current_endurance, status.max_endurance,
status.current_willpower, status.max_willpower,
status.next_level = r:match( arg )
end
status.current_health = tonumber( status.current_health )
status.max_health = tonumber( status.max_health )
status.current_mana = tonumber( status.current_mana )
status.max_mana = tonumber( status.max_mana )
status.current_endurance = tonumber( status.current_endurance )
status.max_endurance = tonumber( status.max_endurance )
status.current_willpower = tonumber( status.current_willpower )
status.max_willpower = tonumber( status.max_willpower )
status.next_level = tonumber( status.next_level )
if sipper.tracking == 1 then
sipper.healthdifference = status.current_health - sipper.prev_health
sipper.manadifference = status.current_mana - sipper.prev_mana
tempLineTrigger(1,1,[[echoChange()]])
end
-- Change these to set where you start sipping - right now you start sipping at 300 under
-- your max health or mana and start eating moss at 800 under your max health or mana
sipper.siphealth = status.max_health*0.6
sipper.sipmana = status.max_mana*0.5
sipper.mosshealth = status.max_health*0.25
sipper.mossmana = status.max_mana*0.25
if sipper.paused == 0 then
if sipper.healbalance == 1 and sipper.priority == 1 then
if status.current_health <= sipper.siphealth then
send("sip health")
sipper.healbalance = 0.5
elseif status.current_mana <= sipper.sipmana then
send("sip mana")
sipper.healbalance = 0.5
end
elseif sipper.healbalance == 1 then
if status.current_mana <= sipper.sipmana then
send ("sip mana")
sipper.healbalance = 0.5
elseif status.current_health <= sipper.siphealth then
send ("sip health")
sipper.healbalance = 0.5
end
end
if sipper.mossbalance == 1 and ( status.current_health <= sipper.mosshealth or status.current_mana <= sipper.mossmana ) then
sendAll("outr moss","eat moss")
sipper.mossbalance = 0.5
end
end
end
function echoChange()
moveCursorEnd("main")
if sipper.healthdifference == 0 and sipper.manadifference == 0 then return end
insertText("(")
if sipper.healthdifference > 0 then
moveCursorEnd("main")
fg("green")
insertText(string.format("+%d Health", sipper.healthdifference))
resetFormat()
elseif sipper.healthdifference < 0 then
moveCursorEnd("main")
fg("red")
insertText(string.format("%d Health", sipper.healthdifference))
resetFormat()
end
if sipper.healthdifference ~= 0 and sipper.manadifference ~= 0 then
moveCursorEnd("main")
insertText(", ")
end
if sipper.manadifference > 0 then
moveCursorEnd("main")
fg("green")
insertText(string.format("+%d Mana", sipper.manadifference))
resetFormat()
elseif sipper.manadifference < 0 then
moveCursorEnd("main")
fg("red")
insertText(string.format("%d Mana", sipper.manadifference))
resetFormat()
end
moveCursorEnd("main")
insertText(")")
end
Re: Vadi Sipper for Achaea
I've been having trouble too, actually. I think the tracking function is somehow broken now, I'll need to take another look at it.
Re: Vadi Sipper for Achaea
Does Vadi's Sipper work with gmcp on?
Re: Vadi Sipper for Achaea
Not without modification to have it work with gmcp instead of atcp.
Re: Vadi Sipper for Achaea
Is that a simple modification? I'd like to have it work while I'm mapping some new areas
Re: Vadi Sipper for Achaea
Do either of these sippers work with mudbot?
Re: Vadi Sipper for Achaea
That depends on the mudbot you use. Some were adapted to let gmcp or atcp pass through.