mrbigtaco
Joined: 26 Jun 2011 Posts: 35
|
Posted: Sun Jun 26, 2011 6:19 am Post subject: Idle tracker |
|
|
I was trying to replicate the functionality of the example modules from the lyntin mud client- the ability to track how long since the last command sent to the mud, and also the ability to change the text of the window title bar (links to the python code from lyntin's example modules below, but not really relevant)
This snippet almost does exactly what I want (with a few limitations):
*It doesn't work with no active sessions.
*I expected SEND OUTPUT event to only trigger on commands sent to the server based on the wording of the help file- it appears to trigger even on commands parsed locally in tintin (like #help and #showme).
I'm assuming the session bit can't be helped, and the SEND OUTPUT even is probably WAD. At any rate, here's the snippet in case someone else wants to use it, improve it. I imagine another possible use would be to incorporate the $idle_time variable into an HP bar with an extra format in a split setup.
| Code: | #event {SEND OUTPUT} {
#var {idle_time} {0};
#format title_bar {idle: %smin\e]2;idle: %smin\e\\} {$idle_time} {$idle_time};
#showme {$title_bar};
#ticker {idle_ticker} {
#math idle_time $idle_time+1;
#format title_bar {idle: %smin\e]2;idle: %smin\e\\} {$idle_time} {$idle_time};
#showme {$title_bar}
} {60}
} |
http://lyntin.sourceforge.net/4.1.1/tutorials/tutorial1.php
http://lyntin.sourceforge.net/4.1.1/tutorials/tutorial2.php |
|