TinTin++ Mud Client The TinTin++ message board

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
TinTin++ Mud Client

A little problem with my autoquaff trigger

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> General Discussion
View previous topic :: View next topic  
Author Message
allfallsdown



Joined: 17 Jul 2005
Posts: 22

PostPosted: Mon Feb 19, 2007 6:09 am    Post subject: A little problem with my autoquaff trigger Reply with quote

Hello, I just recently made an autoquaff trigger for the MUD that I play. Here is the code:

Code:
#al {quaffon} {#var quaff 1}
#al {quaffoff} {#var quaff 0}

#var quaff 0
#var quaffstatus 1
#var quafflimit 900
#var quaffpot restoration
#var quaffhp 2100

#ac {< %1(%2)hp} {#math {quaffhp} {%2 - $quafflimit};#if {"$quaff" == "1"} {#if {"%1" <= "$quaffhp"} {#if {$quaffstatus > 0} {quaff $quaffpot};#var quaffstatus 0}};#if {$spirit > 0} {#showme You cast $spirit Spirit Warriors!};#var spirit 0;#if {$drake > 0} {#showme You cast $drake Spirit Drakes!};#var drake 0;#var skeleton 5} {6}

#action {You feel better.} {#var quaffstatus 1}

#ac {You do not have that item.} {#var quaffstatus 1;get 20 $quaffpot suede}

#ac {You don't see any restoration in the suede.} {#var quaff 0;gt heal me!! i'm dieing!! i'm dieing !!}


OK, well the trigger works fine usually. But it has a small problem...

just as a rough estimate, my character has about 3000 hp. I set #quafflimit to 1500 or so usually, so if I'm less than about 1500 hp, it will auto quaff. The client will quaff when I go under 1500, but for some reason, if my hp goes under 1000, it won't auto quaff... For some reason, it doesn't acknowledge my hp if it has less than 4 digits. It will only acknowledge it if I set the #quafflimit to a 3 digit number.

Anyway, I hope you understand my script and my problem. ANY feedback or help with this would be greatly appreciated.

Thanks in advance Smile
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Mon Feb 19, 2007 6:56 am    Post subject: Re: A little problem with my autoquaff trigger Reply with quote

Quote:

Anyway, I hope you understand my script and my problem. ANY feedback or help with this would be greatly appreciated.

First suggestions would be to indent your scripts so they're more readable.

Regarding your problem:

#if {"%1" <= "$quaffhp"}

That's a string comparison, and will indeed stop working when your hp goes under 1000. Try the following instead:

#if {%1 <= $quaffhp}
Back to top
View user's profile Send private message Send e-mail
allfallsdown



Joined: 17 Jul 2005
Posts: 22

PostPosted: Mon Feb 19, 2007 7:07 am    Post subject: Reply with quote

ok, i gave that shot, this is what i'm getting:

MATH EXP: PARANTESES FOUND INSIDE INTEGER
#ERROR: #MATH EXP: INVALID INPUT {2913(3030)hp 2439(3156)mana 992(1000)mv Buf:healthy Vic:battered > < 2913 <= 2130}

also, sorry about not writing out my scripts the correct way. i should get used to doing that (n00b here) Smile
Back to top
View user's profile Send private message
allfallsdown



Joined: 17 Jul 2005
Posts: 22

PostPosted: Mon Feb 19, 2007 7:45 am    Post subject: Reply with quote

ah nevermind, i fixed it... your solution w orked by the way, thanks so much Smile
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Mon Feb 19, 2007 1:33 pm    Post subject: Reply with quote

You're welcome Smile
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> General Discussion All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads
TinTin++ Homepage

Powered by phpBB © 2001, 2002 phpBB Group