Skip to content
MSN Addons

Away Status

A TG007 community discussion started by nyt1972.

Discussion 18 posts
Page 1 of 1
Open
Topic #6187 · 18 published posts · 2,382 views

Hello guys,

 

Can I have a code which reply to the one who whsiper on my bot while I am away. For exapmle my bot reply MyBot: Sorry my boss is away, take care.

 

Thanks.

raw 305:*: unset %away. [ $+ [ $cid ] $+ . $+ [ $me ] ]
raw 306:*: set %away. [ $+ [ $cid ] $+ . $+ [ $me ] ] $true
on *:TEXT:?: { if (%away. [ $+ [ $cid ] $+ . $+ [ $me ] ]) { msg $nick Sorry my boss is away, take care | closemsg $nick | haltdef } }

 

This is based upon your script being away in the room. So if your script is set to away, this should do the job.

Ok thanks but is there any way to press a button and it do this work without being away.

raw 305:*: unset %away. [ $+ [ $cid ] $+ . $+ [ $me ] ]
raw 306:*: set %away. [ $+ [ $cid ] $+ . $+ [ $me ] ] $true
on *:TEXT:*:?: { if (%away. [ $+ [ $cid ] $+ . $+ [ $me ] ]) || (%mba == on) { msg $nick $iif(%mbam,%mbam,Sorry my boss is away $+ $chr(44) take care) | closemsg $nick | haltdef } }
menu * {
 -
 Message of being away $iif(%mba == on,[on],[off])
 .$iif(%mba == on,$style(2)) Turn On : set %mba on
 .$iif(%mba != on,$style(2)) Turn Off : unset %mba
 .-
 .Message to user
 ..View : echo -at Message : %mbam
 ..Change : %mbam = $$?="Enter the new message"
}

 

This covers both, so if you turn it on, it will automatically do it, but if you have it off, and you go away, it will also do it.

Edited Mar 13, 2006 5:30 AM by The Gate Keeper

Truned it on and then off but its not working.

The reason it didn't work was because the on text coding was wrong. Try this...

 

raw 305:*: unset %away. [ $+ [ $cid ] $+ . $+ [ $me ] ]
raw 306:*: set %away. [ $+ [ $cid ] $+ . $+ [ $me ] ] $true
on *:TEXT:*:?: { if (%away. [ $+ [ $cid ] $+ . $+ [ $me ] ]) || (%mba == on) { msg $nick $iif(%mbam,%mbam,Sorry my boss is away, take care) | closemsg $nick | haltdef } }
menu * {
-
Message of being away $iif(%mba == on,[on],[off])
.$iif(%mba == on,$style(2)) Turn On : set %mba on
.$iif(%mba != on,$style(2)) Turn Off : unset %mba
.-
.Message to user
..View : echo -at Message : %mbam
..Change : %mbam = $$?="Enter the new message"
}

Now its showing an error " * Invalid parameters: $iif ".

I see that warrior's coding is right and i dont see any error :s.

 

 

There is nothing so absurd but some philosopher has said it

But its giving me this error:

 

* Invalid parameters: $iif

Did you delete gatekeeper's code and replaced this one because just now i tested it and its working perfect i dint get any * Invalid parameters: $iif .

 

 

There is nothing so absurd but some philosopher has said it

yes I did, but it show the error when it will be on and some one whispers to the bot.

You are right, nyt1972. It is because of the extra , in it. Here is the new code...

raw 305:*: unset %away. [ $+ [ $cid ] $+ . $+ [ $me ] ]
raw 306:*: set %away. [ $+ [ $cid ] $+ . $+ [ $me ] ] $true
on *:TEXT:*:?: { if (%away. [ $+ [ $cid ] $+ . $+ [ $me ] ]) || (%mba == on) { msg $nick $iif(%mbam,%mbam,Sorry my boss is away $+ $chr(44) take care) | closemsg $nick | haltdef } }
menu * {
-
Message of being away $iif(%mba == on,[on],[off])
.$iif(%mba == on,$style(2)) Turn On : set %mba on
.$iif(%mba != on,$style(2)) Turn Off : unset %mba
.-
.Message to user
..View : echo -at Message : %mbam
..Change : %mbam = $$?="Enter the new message"
}

 

I replaced the correct , with $chr(44) which should now work. :)

modified my coding to suite the fix-ups. Guess that what you get for not testing code :P

Thanks Warrior,

 

Yes its working now. Very good man.

 

Thanks to TGK as well, who reply me immidiatly every time I post. And thanks to Techgear as well, where all the good pplz are gethered to help others.

I want a little more, this addon reply the person who wispher my bot, but dont show his message, What I want is that, it do show his message and reply him as well.

When someone whispers you, you can record it to a txt file

on *:text:?:{ set %wnick $nick | write whisper.txt $2- | close -m %wnick | msg # Whisper recorded from $nick } 

Then to view them through a user, you can do this

on list:text:.wlog:#: { if $read(text\whisper.txt, 1) { var %today $asctime(dd/mm/yyyy) | var %a 1 | var %b $lines(text\whispers.txt) 
   while (%a <= %b) { notice $nick %a $+ . $replace($read(text\whisper.txt, %a),%today,Today) | inc %a }
 }
 else { msg # No new whispers }
}
on list:text:.cwlog:#: { write -c text\whisper.txt | msg # All whispers cleared out as requested }
on list:text:.rwlog*:#: { write -dl $2 text\whisper.txt | msg # Whisper number $2 has been deleted as requested }
on list:text:.mwlog*:#: { msg # Messaging whisper number $2 to the room as requested | msg # $read(text\whisper.txt,$2) }

Something like that should work.

Edited Mar 29, 2006 1:38 PM by X-Fusion
raw 305:*: unset %away. [ $+ [ $cid ] $+ . $+ [ $me ] ]
raw 306:*: set %away. [ $+ [ $cid ] $+ . $+ [ $me ] ] $true
on *:TEXT:*:?: { if (%away. [ $+ [ $cid ] $+ . $+ [ $me ] ]) || (%mba == on) { msg $nick $iif(%mbam,%mbam,Sorry my boss is away $+ $chr(44) take care) | haltdef } }
menu * {
-
Message of being away $iif(%mba == on,[on],[off])
.$iif(%mba == on,$style(2)) Turn On : set %mba on
.$iif(%mba != on,$style(2)) Turn Off : unset %mba
.-
.Message to user
..View : echo -at Message : %mbam
..Change : %mbam = $$?="Enter the new message"
}

Yes TGK code is working fine. Thanks.