Hey, This is my away scripy.
I'd like to thank my scripter iBill who helped me from the beggining, without him i wouldnt have had a bot, i would have been a stoopid geek, Thanks billy <3
Edit: Fixed the problem where your nick goes back to your normal nick straight away
07/09/2008
Edit: Added on notice, on pm, on action(channel) and on action(pm)
alias Away {
if (%away == off) {
window @awaylog
set %gnick $me
set %reason $1-
set %leftat $ctime | set %leftat2 $time
away %reason
amsg 03[15I am now away.03] [15Reason:15 %reason $+ 15.03] [15I left at:15 %leftat2 $+ GMT15.03]
set %away on
nick Mr`Wiskers|away
}
else {
set %ltime $ctime
set %away off
nick %gnick
ns update
away
Amsg 03[15I am back from:15 %reason $+ 15.03] [15I was gone for:15 $duration($calc( %ltime - %leftat )) 15.03] [15Left at:15 %leftat2 $+ 15.03] }
}
alias Status {
if (%away == on) {
echo You are currently away
}
else {
echo You Are Not Away }
}
on *:TEXT:*:#: {
if ($me iswm $1-) {
set %ltime $ctime
aline -ch @awaylog 3(Channel3): $chan
aline -ch @awaylog 3(Nick3): $nick
aline -ch @awaylog 3(Time3): $time
aline -ch @awaylog 3(Date3): $date $+ .
aline -ch @awaylog 3(Message3): $1-
aline -ch @awaylog ---3Break---
notice $nick 03[15I am away:15 %reason $+ 15.03] [15I have been gone for:15 $duration($calc( %ltime - %leftat )) 15.03] [15Left at:15 %leftat2 $+ EST15.03] }
}
on *:notice:*:?: {
if (%away == on) {
set %ltime $ctime
window @awaylog
aline -ch @awaylog 13(Nick13): $nick
aline -ch @awaylog 13(Time13): $time
aline -ch @awaylog 13(Date13): $date $+ .
aline -ch @awaylog 13(Message13): $1-
aline -ch @awaylog ---3Break---
notice $nick 13[ I am away: %reason $+ . 13] [ I have been gone for: $duration($calc( %ltime - %leftat )) . 13] [ Left at: %leftat2 $+ . 13] }
}
on *:text:*:?: {
if ($nick == -sbnc) halt
if (%away == on) {
set %ltime $ctime
window @awaylog
aline -ch @awaylog 13(Nick13): $nick
aline -ch @awaylog 13(Time13): $time
aline -ch @awaylog 13(Date13): $date $+ .
aline -ch @awaylog 13(Message13): $1-
aline -ch @awaylog ---3Break---
msg $nick 13[ I am away: %reason $+ . 13] [ I have been gone for: $duration($calc( %ltime - %leftat )) . 13] [ Left at: %leftat2 $+ . 13] }
}
on *:action:*:#: {
if (%away == on) {
if ($me iswm $1-) {
set %ltime $ctime
window @awaylog
aline -ch @awaylog 13(Nick13): $nick
aline -ch @awaylog 13(Time13): $time
aline -ch @awaylog 13(Date13): $date $+ .
aline -ch @awaylog 13(Message13): $1-
aline -ch @awaylog ---3Break---
notice $nick 13[ I am away: %reason $+ . 13] [ I have been gone for: $duration($calc( %ltime - %leftat )) . 13] [ Left at: %leftat2 $+ . 13] }
}
}
on *:action:*:?: {
if (%away == on) {
if ($me iswm $1-) {
set %ltime $ctime
window @awaylog
aline -ch @awaylog 13(Nick13): $nick
aline -ch @awaylog 13(Time13): $time
aline -ch @awaylog 13(Date13): $date $+ .
aline -ch @awaylog 13(Message13): $1-
aline -ch @awaylog ---3Break---
notice $nick 13[ I am away: %reason $+ . 13] [ I have been gone for: $duration($calc( %ltime - %leftat )) . 13] [ Left at: %leftat2 $+ . 13] }
}
}
Ok it worked so thats a gooo dthing.Couple thisn here,one is your brackets theres no need for all those,in your amsg you should say why your away as well,just liek you /back alias should remind ppl why you where away.You can chang this on :TEXT:|away:#: { and add
on *:TEXT:*:#: {
if ($me isin $strip($1-)) || (<place your main nick here> isnin $strip($1)) {
do @window stuff
}
}
You also have variable that doesnt have any use in the code it self \'\'set %last.highlight $nick\'\'\'im not sure if you attempted some form of flood protection which i ENCOURAGE you toa dd to any and all scripts that can be exploited like this one.Also use \'\'.\'\' a period before any notices so u dotn spam yourself.So other then the backlashes an i won\'t say u should have them in there or not im sure some on else will lol i don\'t really care personally.Its not a bad script should keep working on it maybe fix her yp a bit.Umm for the hell of it i ll post these types of flood protection they are based on !commands jsut as an example but basic repeatitive actions apply.
on *:TEXT:!commands*:#: {
;simple text even,If !commands is said in a common channel you are in the even will trigger commands.
if (%lock == on) { halt }
;If the lock is on the event will not go any further.And no oen can triiger it untill the lock unsets.
set -u10 %lock on
;Simply sets the lock var ON an unsets it after 10 seconds once triggerd.
.notice $nick Commands here blah
;Just the command line triggered effect sending the commands asked for by the event.
}
Next is a increasing global variable example.(Any user)
on *:TEXT:!commands*:#: {
;simple text even,If !command is said in a common channel you are in the even will trigger commands.
inc -u5 %comandlock 1
if (%comandlock >= 3) {
;These last two lines together mean that if the command !commands is issued in a channel 3 or more times in 5 seconds by anyone it will ignore that persons(LAST PERSON WHO TRIGGERED IT) nickname for 30 seconds.
.notice $nick Please do not flood the command response ty.
;Send a notice askin them to not flood the command
ignore -u30 $nick
;Ignores the flooder\'s nickname for 30 seconds then auto removes it
}
}
;Alternately you can use the same event but use the var ON lock as the first example shows and lock the command alltogether:
on *:TEXT:!commands*:#: {
if (%comandlock_2 == on) { halt }
DO COMMANDS HERE
inc -u5 %comandlock 1
if (%comandlock >= 3) {
set -u10 %comandlock_s on
}
}
Next is a increasing global variable example.(Specific user)
on *:TEXT:!commands*:#: {
;simple text even,If !command is said in a common channel you are in the even will trigger commands.
.notice $nick Please do not flood the command response ty.
;Send a notice askin them to not flood the command
inc -u30 $+(%,_Command_Lock,.,$nick)) 1
if ($($+(%,_Command_Lock,.,$nick),2) >= 3) {
;The two lines above are similar to the last example but are nickname specific.Meaning that if some one triggers the command event more then 3 times in 30 seconds they are ignored BUT others may still use the command.Unlike the last example it has to be flooded by one person and NOT everyone.
ignore -u30 $nick
;Ignores the flooder\'s nickname for 30 seconds then auto removes it
}
}
Well there you have it 4 simple ways to protect yourself against your own commands flooding you.
Next is a simple CTCP flood protection useing the last anty flood i just showed you.
ctcp *:*:*: {
;Will trigger on ANY ctcp issued to you doesn\'t matter what ping,version,time ETC.
inc -u3 $+(%,_CTCP_IGGY,.,$nick)) 1
if ($($+(%,_CTCP_IGGY,.,$nick),2) > 2) {
;Same as the 3rd example above but the time is shorter an the amount of times before it triggers is less.Thsi will only trigger if ONE person floods the command unlike the 3rd example that increases on any of the event triggered.Gives the person time to fix typos if this happens to be used in a bot for commands bein issued i personally use CTCP for my admin bot(but i use hash tables instead) commands.
ignore -u120 $address($nick,4))
;Simply ignores that flooders host so they can no long CTCP flood you.Depending on how an what your bot or script does an how the server or networks is set up you can kick/ban them for ctcp flooding
}
}
And there you have practical use of one of the anty flood examples.Protect yourselves.`-.-
P.S:Sorry for any grammar or misspellings =\ no spell check lol.