This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

timer and set topic

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
b
blake
Master
Posts: 201
Joined: Mon Feb 23, 2009 9:42 am
Contact:

timer and set topic

Post by blake »

Hey

Can someone help with this im looking to get a script that will send a command to a channel every 30 days command is !scores my eggdrop is then noticed of the top 3 ranked players for that month

Notice recieved
-GamesBot (GamesBot@staff.someserver.com)- This month: 1. nick1 (545) 2. nick2 (537) 3. nick3 (194)

id like to then get my bot to set the room topic with /topic #channelname Top three ranked players last month are 1. nick1 (545) 2. nick2 (537) 3. nick3 (194) well done (this bit is left out -GamesBot (GamesBot@staff.someserver.com)- )

bot will then message the channel with command !resetscores

many thanks
b
blake
Master
Posts: 201
Joined: Mon Feb 23, 2009 9:42 am
Contact:

Post by blake »

Okay I have this partially doing what I want it to do on notice it sets the channel topic but it uses the whole of the notice text

Code: Select all

bind notc - "*" user:notice 

proc user:notice {nick uhost handle text dest} { 

   if {"GamesBot"=="$nick"} { 

      putserv "TOPIC #Countdown :Top 3 Players $text" 
     }    
} 
This is what it is setting in the topic
This month: 1. nick1 (545) 2. nick2 (537) 3. nick3 (194)

how do i go about getting it to ignore this part in the notice (This Month:) all i want it to show is 1. nick1 (545) 2. nick2 (537) 3. nick3 (194)

Also if my eggdrop joins my games channel it gets messaged by my gamesbot and sets the topic for any notice it recieves from it can it be set so that it only sets the topic if recieves a notice matching a specific set of text
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

Code: Select all

bind notc - "*" user:notice 

proc user:notice {nick uhost handle text dest} { 
  if {[string equal -nocase "gamesbot" $nick] && [string match -nocase "this month:*" $text]} {
    putserv "TOPIC #Countdown :\002Top 3 Players\002: [string trim [join [lrange [split $text {:}] 1 end]]]" 
  }    
} 
b
blake
Master
Posts: 201
Joined: Mon Feb 23, 2009 9:42 am
Contact:

Post by blake »

Thanks speechless I`ve tried this but it dont do any thing this is the full notice it recieves

-GamesBot (GamesBot@staff.cwukchat.com)- This month: 1. concrete_angel (2553) 2. hammer (1835) 3. crow_lestat (1829)

Only part I want set in the topic is 1. concrete_angel (2553) 2. hammer (1835) 3. crow_lestat (1829)
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

blake wrote:Thanks speechless I`ve tried this but it dont do any thing this is the full notice it recieves

-GamesBot (GamesBot@staff.cwukchat.com)- This month: 1. concrete_angel (2553) 2. hammer (1835) 3. crow_lestat (1829)

Only part I want set in the topic is 1. concrete_angel (2553) 2. hammer (1835) 3. crow_lestat (1829)
The code I provided above does do this. You aren't being honest in your statement above...
This month: 1. concrete_angel (2553) 2. hammer (1835) 3. crow_lestat (1829)
Is that literally what the bot notices you? Because if it is, my code above would have worked. Is there any color, bold, etc in there one would need to be made aware of? If so, use the code below...

Code: Select all

bind notc - "*" user:notice

proc user:notice {nick uhost handle text dest} {
  set text [stripcodes bcruag $text]
  if {[string equal -nocase "gamesbot" $nick] && [string match -nocase "this month:*" $text]} {
    putserv "TOPIC #Countdown :\002Top 3 Players\002: [string trim [join [lrange [split $text {:}] 1 end]]]"
  }   
} 
b
blake
Master
Posts: 201
Joined: Mon Feb 23, 2009 9:42 am
Contact:

Post by blake »

Thanks speechless that worked it was recieving it in bold text
Post Reply