Help - Search - Members - Calendar
Full Version: Tintin++
Achaea's Forums > Off-Topic > Tech Support > Client Help
Penquin
Greetings all,

I've managed to compile TinTin++ for ARM. This is good news! Means I can Mud on the cell phone I have biggrin.gif

However, I'm having issues setting up actions(triggers). I've read a few forums, and checked out the online manual, but I've not been able to determine how to do what I need.

To setup an action in TinTin, we use the following:

#action {This is a line of text to match} {This is the action we do for matching}

To remove a trigger, we use:
#unaction {The matching line of the trigger that was previously setup}



Now, the first one setups a trigger and it's enabled. The second one, REMOVES the trigger. However, what I need done is a way to setup triggers (above) and then enable, or disable them, not remove them!

Zmud uses +t, or -t, to enable and disable right? Well...that's not present in TinTin, not that I've found. Is it posibble to enable/disable a single trigger in TinTin?

Thanks.



So... How would I create a trigger, and then disable it without Removing the trigger
Gorlasintan
Glancing through the TT++ manual ( http://tintin.sourceforge.net/manual/ ) I don't see anything that would do it. :/

Maybe something like setting the priority of the trigger to 0?

#ACTION {blah} {sendblah} {0}

?
Penquin
QUOTE (Gorlasintan @ Jul 11 2009, 03:25 PM) *
Glancing through the TT++ manual ( http://tintin.sourceforge.net/manual/ ) I don't see anything that would do it. :/

Maybe something like setting the priority of the trigger to 0?

#ACTION {blah} {sendblah} {0}

?


Naw, That just sets the trigger to fire after everything else is processed.
Trevize
What about this?

http://tintin.sourceforge.net/manual/ignore.php
Penquin
QUOTE (Trevize @ Jul 11 2009, 04:18 PM) *



Thanks for the reply, Trevize. However, that's a no-go.

One the same page: Actions will no longer trigger.

Ignore turns off all triggers, and then...there would not be a triggering way for me to re-enable them!
Essentially, I am looking for the TinTin++ equivilent of MUSH's EnableTrigger('name', [0,1])

Lana
If all else fails, you could make a trigger to remove all the triggers you're interested in and one to remake them. Would make updating them a bit of a mess, of course, but as a last resort...
Penquin
QUOTE (Lana @ Jul 11 2009, 04:52 PM) *
If all else fails, you could make a trigger to remove all the triggers you're interested in and one to remake them. Would make updating them a bit of a mess, of course, but as a last resort...



YIKES!! that's not a very...safe or desirable way to setup some anti-illusion.
Gorlasintan
You're playing on a cell phone. I don't think that's a very safe or desirable way to mud. tongue.gif
Lana
Anti-illusion are for wussies anyway. Take it like a man!
Penquin
QUOTE (Gorlasintan @ Jul 11 2009, 05:07 PM) *
You're playing on a cell phone. I don't think that's a very safe or desirable way to mud. tongue.gif


Hey...HEY.... angry.gif glare.gif

Maybe. But the questions still stands.

Is asking for a reliable way to enable and disable triggers, too much to ask from a commandline ARM capable mudclient?!

sad.gif
Gorlasintan
Obviously.
Penquin
QUOTE (Gorlasintan @ Jul 11 2009, 05:15 PM) *
Obviously.


That's it pigeon boy. You're going down.

I don't care if your Pigeon does have a gun. My Penguin has ARMOUR. And a sword.


But no capable mudclient. sad.gif
Gorlasintan
QUOTE (Penquin @ Jul 11 2009, 04:26 PM) *
QUOTE (Gorlasintan @ Jul 11 2009, 05:15 PM) *
Obviously.


That's it pigeon boy. You're going down.

I don't care if your Pigeon does have a gun. My Penguin has ARMOUR. And a sword.


But no capable mudclient. sad.gif

My penguin has an SoA, rapier and rabies.



EDIT: Also Empoleon.
Bannin
Why would you need to disable and enable them?
CODE
#class {serpent} {kill}
#class {serpent} {open}
#var allowVenom 0
#act {^%0 stabs you in the face.} {#var allowVenom = 1}
#act {^Hmm. Why must everything be so stupid.} {
  #if{@allow{}} {
    afflict stupidity
  }
}
#fun {allow} {
  #if {@allowVenom > 0} {
    #math {allowVenom} {$allowVenom - 1};
    #var result 1
  } {
    #var result 0
  }
}
#class {serpent} {close}
Penquin
QUOTE (Bannin @ Jul 12 2009, 06:50 AM) *
Why would you need to disable and enable them?
CODE
#class {serpent} {kill}
#class {serpent} {open}
#var allowVenom 0
#act {^%0 stabs you in the face.} {#var allowVenom = 1}
#act {^Hmm. Why must everything be so stupid.} {
  #if{@allow{}} {
    afflict stupidity
  }
}
#fun {allow} {
  #if {@allowVenom > 0} {
    #math {allowVenom} {$allowVenom - 1};
    #var result 1
  } {
    #var result 0
  }
}
#class {serpent} {close}



Okay, so that shows a class of triggers.

1) How are they enabled it not when created?
2) How would you ensure they didn't fire, say if the class of triggers I wanted to enable was monk??


Trevize
He's saying make an if statement surround the contents of the trigger's script. Make that if statement match a variable. Instead of turning off the trigger, turn off the variable.
Bannin
Exactly. Though #class could be useful for enabling/disabling different ig classes, I guess.

QUOTE
Syntax: #class {name} {open|close|read filename|write filename|kill}

The {open} option will open a class, all triggers added afterwards will be assigned to that class.

The {close} option will close the given class and make the last accessed open class active.

The {read} option will open the given file, but only read triggers belonging to the given class.

The {write} option will write all triggers of the given class to file.

The {kill} option will delete all triggers of the given class.


I'm not a fan of enabling/disabling triggers for anti-illusion and similar myself. Something like:
CODE
#action {^You have slain} {
  #action {^You have recovered} {
    get gold;
    get shard;
    #unaction {^You have recovered}
  }
}

...would probably be the closest thing to that sort of functionality, but it's not very practical
Penquin
Hello again,

I'm in need of some TinTin++ help once again.

I appreciate the help from last time; but this problem is a little bit different.


I'm trying to write an updater script for the news archive, in tt++. It's about the only client that will run from command line, on a UNIX server, and that has at least SOME documentation.

I've gotten everything ALMOST working. However, when I try to #action a trigger that has arguments as part of the action, in a function; the functions arguments are passed instead!

CODE
#function {readnews}
    {
    
    #if {"%1"=="public"}
        {
            
        #if {    "%2" < "%3"}
            {
            #math read {%2 + 1};
            #send {readnews %1 $read}
            }
        
            {
            #unaction {Public:%sRead%s%d/%d%sarticles.%*};
            #action {Announce:%sRead%s%d/%d%sarticles.%*} {@readnews{announce %3 %4}};
            #send {nstat}
            };
        
        };


For that bit of code, I get the following output with #DEBUG ALL ON:
CODE
#DEBUG ACTION {Public:%sRead%s%d/%d%sarticles.%*}
[17] @readnews{public 18264 18264} <---FIRST CALL
#DEBUG FUNCTION {readnews}
[10] if {"public"=="public"}
[10]     if {    "18264" < "18264"}
[05]     endif
[06]     else
[02]         unaction {Public:%sRead%s%d/%d%sarticles.%*}
#OK. {Public:%sRead%s%d/%d%sarticles.%*} IS NO LONGER AN ACTION.
[02]         action {Announce:%sRead%s%d/%d%sarticles.%*} {@readnews{announce
18264 }}
#OK. {Announce:%sRead%s%d/%d%sarticles.%*} NOW TRIGGERS {@readnews{announce
18264 }} @ {5}.
[02]         send {nstat}
[05]     endif
[05] endif
[07] elseif {"public"=="announce"}
[05] endif
[07] elseif {"public"=="events"}
[05] endif
[06] else
[05] endelse
[17] $result
Public:           Read 18264/18264 articles.
#DEBUG ACTION {Announce:%sRead%s%d/%d%sarticles.%*}
[17] @readnews{announce 18264 }
#DEBUG FUNCTION {readnews}
[10] if {"announce"=="public"}
[05] endif
[07] elseif {"announce"=="announce"}
[10]     if {    "18264" < ""} <-- DROPS TROUGH, BUT TAKES THE ABOVE %3, WITHIT INSTEAD OF CREATING A NEW TRIGGER WITH LITERAL VALUE %3
[05]     endif
[06]     else


As you can see, its passing the original arguments from the function ('18264') as the parameters for the #action instead of creating the action as a literal string:

IE, the action is being created as
CODE
#OK. {Announce:%sRead%s%d/%d%sarticles.%*} NOW TRIGGERS {@readnews{announce18264 }} @ {5}.

Instead of what I WANT it to do :
CODE
#OK. {Announce:%sRead%s%d/%d%sarticles.%*} NOW TRIGGERS {@readnews{announce %3 %4}} @ {5}.


Is anyone able to correct this, or lend me a few hints/code snippets where the last code block above, will work in a function with arguments??

Thank you.
Penquin
All right; more code coming your way.


I've separated each call to read a section into classes and put in a separate function for each. It works this way...or , sorta.

The code is as follows:
CODE
#function {readpublic }
    {
                    
        #if {    "%1" < "%2"}
            {
            #math {read} {%2 + 1};
            #send {readnews public $read}
            
            }
        
            {
            #class {public} {kill};
            #class {announce} {open};
            #send {nstat}
            };
    }
    
#function {readannounce}
    {
        
        #if {    %1 < %2}
            {
            #math {read} {%2 + 1};
            #send {readnews announce $read}
            }
        
            {
            #class {announce} {kill};            
            #class {events} {open};
            #send {nstat}
            };
        }
#function {readevents}

    {
        #if {    "%1" < "%2"}
            {
            #math {read} {%2 + 1};
            #send {readnews events $read}
            }
        
        {
        #class {events} {close};
        #send {qq}
        };
    }
        
#action {Penned by my hand on the %d%*.} {#send {nstat}}
#action {[Type MORE if you wish to continue reading. (%d\% shown)]} {#send {more}}

#class {announce} {open}
#action {Announce:%sRead%s%d/%d%sarticles.%*} {@readannounce{%3 %4}}
#class {close}

#class {events} {open}
#action {Events:%sRead%s%d/%d%sarticles.%*} {@readevents{%3 %4}}
#class {close}

#class {announce} {close}
#class {events} {close}

#class {public} {open}
#action {Public:%sRead%s%d/%d%sarticles.%*} {@readpublic{%3 %4}}
#class {public} {closs}



Now, there's a few issues with this. And I can't figure out how to make it work the way I need/want it to.

1) Even with the #MATH Variable being updated (or so it says), the VERY next line afterwards to send that number to the mud, sends a literal $read, instead of a variable.

DEBUG:
CODE
[02]     math {read} {3081 + 1}
#MATH: VARIABLE {read} HAS BEEN SET TO {3082}.
[02]     send {readnews announce $read}


2) The entire nstat is read and parsed at once, Even though I explicitly state for the triggers in the class to read a section, remain CLOSED(disabled)

DEBUG:
CODE
News summary for Rakon:

#DEBUG ACTION {Public:%sRead%s%d/%d%sarticles.%*}
[17] @readpublic{18264 18264}
Public:           Read 18264/18264 articles.
#DEBUG ACTION {Announce:%sRead%s%d/%d%sarticles.%*}
[17] @readannounce{3080 3081}
#DEBUG FUNCTION {readannounce}
[10] if {    3080 < 3081}
[02]     math {read} {3081 + 1}
#MATH: VARIABLE {read} HAS BEEN SET TO {3082}.
[02]     send {readnews announce $read}
[05] endif
[06] else
[05] endif
[17] $result
Announce:         Read 3080/3081 articles.
#DEBUG ACTION {Events:%sRead%s%d/%d%sarticles.%*}
[17] @readevents{307 308}
#DEBUG FUNCTION {readevents}
[10] if {    "307" < "308"}
[05] endif
[06] else
[02]     class {events} {close}
#CLASS {events} IS ALREADY CLOSED.
[02]     send {qq}
[05] endif
[17] $result


3)This ends up sending a whole bunch of CRAP to the mud, and not actually doing anything:

DEBUG:
CODE
2298h, 2784m, 10390e, 12820w exdb-
Come again?
2298h, 2784m, 10390e, 12820w exdb-
2298h, 2784m, 10390e, 12820w exdb-
That went right over my head.
2298h, 2784m, 10390e, 12820w exdb-
2298h, 2784m, 10390e, 12820w exdb-
Please restate.
2298h, 2784m, 10390e, 12820w exdb-

2298h, 2784m, 10390e, 12820w exdb-


And even though, I have config command echo on (in TinTin++), NOTHING from that script is shown, from any #send command.


Any ideas for correcting this please?
Bannin
I don't get it. I'll take another look after I catch up on this week's sleep, but the caffeine is telling me
CODE
#action {Announce:%sRead%s%d/%d%sarticles.%*} {@readnews{announce %3 %4}};
from the first post might work better as
CODE
#action {Announce:%sRead%s%d/%d%sarticles.%*} {@readnews{announce %%3 %%4}};


If that doesn't help at all, add some more %'s. If that doesn't help, try the tt++ forums. The developer is very active there, and usually replies to my questions within a day of posting them, often with a complete rewrite of my script in some ingenious way I'd never have thought of.

Edit: Looking over the second post, I think you might have the wrong idea about how classes work. #class {something} {open} just means anything you add after that point (up until #class{something} {close}) is in the class and can be removed with #class {something} {kill}. {kill} kills it stone dead and disposes of the remains. A subsequent {open} will just start a new class by the same name. It's not the same as zmud's #T+ (Or was it #classon?), it just means the next #alias, #var, #action or #fun is appended to that class. You can sort of get the enable/disable functionality if you store each class in a separate file, then you can "enable" it with #class {something} {read sometriggers.tt} and "disable" with kill.

I don't think I've ever used #send, but I'm guessing it's supposed to not do anything to the arguments. Instead of
CODE
#send {readnews public $read}
you could just have
CODE
readnews public $read
Penquin
Thank you for the quick reply.

I have taken your advice, and seperated the classes of actions into different configuration files. As well, I changed the #send to plain text response instead of the #send function.

I've also changed my functions into aliases. Now, I have the following code block and the subsequent debug. However, as it goes through the code block, it does not send ANYTHING to the mud now. I even attempted to change the readnews, back into a #send function. Nothing seems to actually send the output now, and the variable $read is STILL not being expanded in an alias.


CODE
#alias {readpublic}
    {
                    
        #if {    %1 < %2}
            {
            #math {read} {%2 + 1};
            readnews public $read
            }
            
        
            {
            #read {announce.tin};
            nstat}
    };


DEBUG:
CODE
#DEBUG ACTION {Public:%sRead%s%d/%d%sarticles.%*}
[17] readpublic 18263 18264
#DEBUG ALIAS {readpublic} {18263 18264}
[10] if {    18263 < 18264}
[02]     math {read} {18264 + 1}
#MATH: VARIABLE {read} HAS BEEN SET TO {18265}.
[17]     readnews public $read
[05] endif
[06] else
[05] endif
2298h, 2784m, 10390e, 12820w exdb-
2298h, 2784m, 10390e, 12820w exdb-


Nothing is sent to the MUD. What could I do to get the command 'readnews public $read' sent to the mud, expanding the read Variable?
Dontarion
Why not just get a netbook and tether?
Penquin
QUOTE (Dontarion @ Oct 9 2009, 02:42 PM) *
Why not just get a netbook and tether?



Netbook cost more money.

That, and I'm not mudding on my device anymore.

This is me trying to get a script to parse the news reading automatically for logging, from a server.
Penquin
Small update for those who might care.

I went back to my original project of getting TinTin++ working for my phone.

After a bit of mucking around, and some cross-compiling fiasco's I now have Achaea on the go:







Yes, the 'logging on' picture comes after the reading of the news post; I scrolled back up, to screen capture the log on.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.