egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Fun Script

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
dohko2006
Voice


Joined: 19 Mar 2006
Posts: 8

PostPosted: Sun Mar 19, 2006 2:59 pm    Post subject: Fun Script Reply with quote

small request (i thing), im looking for after a forum search (maybe im not good searching, sorry)


when ops (+o) or voices (+v) (only this two) type: !rock nick ... the bot respond
* Bot throws a rock in the head of Nick

a tiny example (nicks: Bot, +Nick, AnotherNick)

<+Nick>!rock AnotherNick
* Bot throws a rock in the head of AnotherNick
<AnotherNick> lol
<AnotherNick> !rock Nick
<AnotherNick> wtf... not work!
<+Nick> lol...only voices and ops Razz

and antiflood ... 4 or 5 respond total in 90-120 sec ... thx a lot.

Regards.
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sun Mar 19, 2006 4:12 pm    Post subject: Reply with quote

Code:
bind pub - !rock rock

proc rock {nick uhost hand chan arg} {
 global afrock
 if {![isvoice $nick $chan] && ![isop $nick $chan]} {return 0}
 if {![info exists afrock([set nickchan [string tolower $nick:$chan]])]} {
  set afrock($nickchan) [list [unixtime] 0]
 }
 foreach {t o} $afrock($nickchan) {break}
 if {[unixtime]-$t > 120} { set t [unixtime]; set o 0 }
 if {[incr o] > 5} { return 0 }
 set afrock($nickchan) [list $t $o]
 putserv "privmsg $chan :\001ACTION throws a rock in the head of [lindex [split $arg] 0]\001"
}

_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
dohko2006
Voice


Joined: 19 Mar 2006
Posts: 8

PostPosted: Fri Mar 24, 2006 10:56 am    Post subject: Reply with quote

Great work Sir_Dz Very Happy Working Ok... but...

If AnotherNick dont exists ... the command
!rock AnotherNick it would not have to work; and if type only "!rock" the bot say "* Bot throws a rock in the head of"

Example (Only 3 Users in the channel: Bot, +Nick, Nick2)
<+Nick>!rock Nick2
* Bot throws a rock in the head of Nick2
<Nick2>lol
<+Nick>!rock Nick3
<Nick2> Nick3? who is?
<+Nick> lol, the user Nick3 dont exist in the channel, good bot :p
<+Nick>!rock
<Nick2> nothing happen
<+Nick> of course, not type nick :p

My bot only have one channel, but have 100 -300 users daily in the channel.

Regards Smile
Back to top
View user's profile Send private message
astriK
Voice


Joined: 23 Mar 2006
Posts: 5

PostPosted: Fri Mar 24, 2006 11:14 am    Post subject: Reply with quote

dohko2006 wrote:
Great work Sir_Dz Very Happy Working Ok... but...

If AnotherNick dont exists ... the command
!rock AnotherNick it would not have to work; and if type only "!rock" the bot say "* Bot throws a rock in the head of"

Example (Only 3 Users in the channel: Bot, +Nick, Nick2)
<+Nick>!rock
<Nick2> nothing happen
<+Nick> of course, not type nick :p
Regards Smile

that example is meaning the Bot fine.
maybe u wana say it
<+Nick>!rock
<BoT> Bot throws a rock in the head of"
isn't?
_________________
DomDom DomDom
Back to top
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Fri Mar 24, 2006 3:14 pm    Post subject: Reply with quote

Code:

bind pub - !rock random:rock

proc random:rock {nick uhost hand chan arg} {
  if {![isop $nick $chan] || ![isvoice $nick $chan]} return
  foreach user [chanlist $chan] {
    if {[isbotnick $user] || [isvoice $user $chan] || [isop $user $chan]} continue
    lappend list $user
  }
  if {[set len [llength $list]] < 2} {
    putserv "PRIVMSG $chan :This game needs more than two users on the channel, currently I see only [expr {$len==1?"1 player":"$len players"}]."
    return
  }
  putserv "PRIVMSG $chan :\001ACTION throws a rock in the head of [lindex $list [rand $len]]\001"
}

_________________
Once the game is over, the king and the pawn go back in the same box.
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Fri Mar 24, 2006 7:55 pm    Post subject: Reply with quote

This should fix it
Code:
bind pub - !rock rock

proc rock {nick uhost hand chan arg} {
 global afrock
 if {![isvoice $nick $chan] && ![isop $nick $chan]} {return 0}
 if {![info exists afrock([set nickchan [string tolower $nick:$chan]])]} {
  set afrock($nickchan) [list [unixtime] 0]
 }
 foreach {t o} $afrock($nickchan) {break}
 if {[unixtime]-$t > 120} { set t [unixtime]; set o 0 }
 if {[incr o] > 5} { return 0 }
 set afrock($nickchan) [list $t $o]
 if {[onchan [set rocked [lindex [split $arg] 0]] $chan]} {
  putserv "privmsg $chan :\001ACTION throws a rock in the head of $rocked\001"
 }
}

_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
dohko2006
Voice


Joined: 19 Mar 2006
Posts: 8

PostPosted: Sun Mar 26, 2006 11:54 am    Post subject: Reply with quote

Works OK Now Cool ... thx a lot Sir ^^
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber