bandbonjtv commented on a Page, on text away script thing  -  Jan 30, 2013

IM NO EXPERT!
this is what i came up with from jsg55's script for my bot, thank you jsg55. i couldnt figure out how to get the script to read the nickname in the text to automatically trigger. ex: "where is john?" the script would then return the status for "john" like i wrote below. or how to get this lil peice of code into the script. preferably the auto trigger anywhere in text. please help if you can, so i can clean up the code im using and also learn more. thank you.

snippet - it only works if i have it in a different file for some reason. please help me include it or make it automatically trigger upon mention of $nick in chat by any user. wether they have a status or not. if they do, then display status, if not, then display alternate generic status.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
on :text:!status :#:{
if ($readini(away.ini, $2, away) == on) {
msg $chan $2 is $readini(away.ini, $2, reason) and has been gone $duration(%time [ $+ [ $2 ] ]) }
if ($readini(away.ini, $2, away) != on) {
msg $chan $2 is either Watching the show, or Silently Lurking. If they dont respond, Try harder. } }
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
on $:text:/^(brb|bbl|afk|bbiab)\b/Si:#:awaycheck $1-
on $
:action:/^(brb|bbl|afk|bbiab)\b/Si:#:awaycheck $1-

alias -l awaycheck {
if ($2 == $null) { writeini away.ini $nick reason lurking. }
if ($2 != $null) { writeini away.ini $nick reason $remove($2-,$chr(36)) }
msg # $nick is now $readini(away.ini, $nick, reason)
writeini away.ini $nick away on | set %away [ $+ [ $nick ] ] on | set %time [ $+ [ $nick ] ]
if ($readini(away.ini, $nick, away) == on) inc -c %time [ $+ [ $nick ] ]
}
on :text::#:awaycheck2 $1-
on :action::#:awaycheck2 $1-

alias -l awaycheck2 {
if ($readini(away.ini, $nick, away) == on) {
msg # welcome back $nick $+ , You were gone $duration(%time [ $+ [ $nick ] ])
remini away.ini $nick | unset %away [ $+ [ $nick ] ] on | unset %time [ $+ [ $nick ] ] }
}
}

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.