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

#IF

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



Joined: 02 Jan 2007
Posts: 16

PostPosted: Tue Jan 02, 2007 11:59 pm    Post subject: #IF Reply with quote

Eh, sorry for all the queries, but i'm new to tintin++ and prog. language in general.

What i'm trying to setup is an auto-heal script, so far it's simple, but it doesn't work.

My prompt is %1hp %2ma %3mv %4xp >

I have this so far:
Code:
#action {%1hp %2ma %3mv %4xp >} {#IF {%1<100} {heal}

I get a bracket format error on inputting the #act, and it doesn't work.

Any comments/help is greatly appreciated. Thanks for reading and putting up with a newbie Big Smile
_________________
TinTin++ is great, thanks to creator(s)
Back to top
View user's profile Send private message AIM Address
davevnj



Joined: 22 Nov 2006
Posts: 55

PostPosted: Wed Jan 03, 2007 12:21 pm    Post subject: Reply with quote

try:
Code:
#action {%1hp %2ma %3mv %4xp >} {#IF {%1<100} {heal}}

You didn't close the bracket that you opened before the #IF.
Back to top
View user's profile Send private message Visit poster's website
bloodbunnyn



Joined: 02 Jan 2007
Posts: 16

PostPosted: Wed Jan 03, 2007 5:37 pm    Post subject: Reply with quote

Ah, that works well.
Thank you davenj Big Smile
_________________
TinTin++ is great, thanks to creator(s)
Back to top
View user's profile Send private message AIM Address
bloodbunnyn



Joined: 02 Jan 2007
Posts: 16

PostPosted: Wed Jan 03, 2007 5:51 pm    Post subject: Reply with quote

Err, ok. So I want to may my auto-heal script more complicated, how do I go about this?

Code:
#action {%1HP} {#IF {%1<100} {heal}}


is fairly simple, in a fight, every prompt I get back that is below 100, I will send a heal to the mud. this gets VERY spammy and redundant.

Is there anyway to make the script a bit more complex so I will ONLY cast heal if I actually need it? (under 100hp).

Any advice/comments are appreciated. Thank you.
_________________
TinTin++ is great, thanks to creator(s)
Back to top
View user's profile Send private message AIM Address
bloodbunnyn



Joined: 02 Jan 2007
Posts: 16

PostPosted: Wed Jan 03, 2007 7:31 pm    Post subject: Reply with quote

Ok, I have another idea. Make it so if

Hp < 100 then heal but ONLY if Mana > 15

ideas? Still so new to the #IF Big Smile
_________________
TinTin++ is great, thanks to creator(s)
Back to top
View user's profile Send private message AIM Address
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Wed Jan 03, 2007 8:24 pm    Post subject: Reply with quote

The following might work:

Code:

#var healdelay 0

#action {%1hp %2ma %3mv %4xp >}
{
  #IF {%1 < 100 && %2 > 15 && $healdelay == 0}
  {
    heal;
    #var healdelay 1;
    #delay 6 #var healdelay 0
  }
}

You can lookup the && and || stuff in most online C/C++ manuals for beginners. Tintin uses the same syntax for pretty much all logical and mathematical operations.
Back to top
View user's profile Send private message Send e-mail
bloodbunnyn



Joined: 02 Jan 2007
Posts: 16

PostPosted: Sat Jan 06, 2007 2:44 pm    Post subject: Reply with quote

I'm having problems with simply entering code into the text document then saving and reading said document in TT.

the actions will be nestled inside variables, and all kinds of shenannigans.

I merely copy and pasted the script posted above at the bottom of my written TT file, and it had the action in the top variable.

Should I paste new scrips in new documents, read them in TT, then write them to my main configuration?
_________________
TinTin++ is great, thanks to creator(s)
Back to top
View user's profile Send private message AIM Address
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Sun Jan 07, 2007 8:37 am    Post subject: Reply with quote

You might have a bracing error somewhere if that happens. But reading it in seperately than writing all your stuff to one file ought to do the trick as well, though you'll lose the formatting.
Back to top
View user's profile Send private message Send e-mail
davevnj



Joined: 22 Nov 2006
Posts: 55

PostPosted: Tue Jan 09, 2007 10:38 am    Post subject: Reply with quote

Also be aware that there are two separate commands there, your #VAR and your #ACTION.

If you are calling those commands within another command (like an alias), you need a ";" to separate them.
Back to top
View user's profile Send private message Visit poster's website
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