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 

Mondgesicht Script

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


Joined: 16 Aug 2006
Posts: 19

PostPosted: Sun Mar 31, 2013 11:43 am    Post subject: Mondgesicht Script Reply with quote

Hey everybody =)
I need an little help with mondgesicht.tcl
This script is building a moon face by users like ..,- what means Smile
I searched the internet for a long time and found a script.
But the script is not working.
I am a noob @ tcl -.-
the script should react on . , - in my channel
I uploaded the script an loaded it, nothing happend Sad
I hope someone can help me with that.
Have I to start the script somehow? Found nothing in the script for that.
I also miss the option for the channel.
I want that script to work only in one of my channels.

I would appreciate your help a lot!!!

Code:

## HoLGI development
## ..,- mondgesicht

## -> www.ircscript.de

bind PUBM -|- * mondgesichtparser

set mond(sprueche1) {
   "WAHNSINN! Ein Punkt! Was soll ich denn jetz damit? Oder wird das mal ein Mondgesicht? "
   "Punkt Punkt Punkt... Ach so! Mondgesicht soll das werden! Dann mach ma jemand hier weiter! "
   "Soll dieser Punkt jetzt das Ende eines Satzes darstellen oder den Anfang von einem Mondgesichts? "
   "So Leude, es geht wieder ma rund! Ein Mondgesicht wurde angefangen... Gibt mir wer nen zweiten Punkt? "
   "Noch 'n Punkt, sonst wird das kein Mondgesicht! "
}

set mond(sprueche2) {
   "Hmm.. Noch ein Punkt! Jetzt wird's ernst! Macht ma das Mondgesicht hier fertig! "
   "Das wird ja immer bunter hier! Jetzt haben wir schon zwei Punkte! "
   "NOCH EIN PUNKT! Unglaublich dass ihr es so weit bringt! Jetzt müsst ihr ein KOMMA machen, nur so als Info! "
   "Wird's heute noch was? Jetzt noch ein Komma und 'n Strich und wir sind alle glücklich! "
}

set mond(sprueche3) {
   "So... und nun? Jetzt noch nen STRICH bitte, dann wird hier endlich nich mehr genervt... "
   "Ein KOMMA! Ganz richtig! Und jetzt noch nen Strich und ich bin in der Glückseligkeit (: "
   "Und nu?? Wo bleibt der STRICH? "
   "LOS LOS! Nur noch ein STRICH und die Sache hier is endlich gegessen! "
   "Glückwunsch dass ihr es so weit gebracht habt... Jetzt, was fehlt noch? Hm? Nachdenken! - DER STRICH! "
}

setudef flag mondgesicht
setudef str  mondgesicht_count

proc mondgesichtparser { nickname hostname handle channel arguments } {

   if { ![channel get $channel mondgesicht] } { return 0 }
   if { [info exists ::mond(flood,$channel)] } { return 0 }

   if { ![info exists ::mond(hosts,$channel)] } {
      set ::mond(hosts,$channel) ""
   }

   if { [string match "*$hostname*" $::mond(hosts,$channel)] } { return 0 }

   if { ![info exists ::mond(status,$channel)] && $arguments == "." } {
      set ::mond(anfang) [clock seconds]
      set spruch [lindex $::mond(sprueche1) [rand [expr [llength $::mond(sprueche1)] - 1]]]
      putquick "privmsg $channel :$spruch ($nickname)"
      set ::mond(status,$channel) 2
      lappend ::mond(hosts,$channel) $hostname
      lappend ::mond(nicks,$channel) $nickname
      return 0
   }

   if { [info exists ::mond(status,$channel)] && $arguments == "." && $::mond(status,$channel) == 2 } {
      set spruch [lindex $::mond(sprueche2) [rand [expr [llength $::mond(sprueche2)] - 1]]]
      putquick "privmsg $channel :$spruch ($nickname)"
      set ::mond(status,$channel) 3
      lappend ::mond(hosts,$channel) $hostname
      lappend ::mond(nicks,$channel) $nickname
      return 0
   }

   if { [info exists ::mond(status,$channel)] && $arguments == "," && $::mond(status,$channel) == 3 } {
      set spruch [lindex $::mond(sprueche3) [rand [expr [llength $::mond(sprueche3)] - 1]]]
      putquick "privmsg $channel :$spruch ($nickname)"
      set ::mond(status,$channel) 4
      lappend ::mond(hosts,$channel) $hostname
      lappend ::mond(nicks,$channel) $nickname
      return 0
   }

   if { [info exists ::mond(status,$channel)] && $arguments == "-" && $::mond(status,$channel) == 4 } {
      set ende [clock seconds]
      set time [expr $ende - $::mond(anfang)]
      lappend ::mond(nicks,$channel) $nickname
      set count [expr [channel get $channel mondgesicht_count] + 1]
      if { $count == "" } {
         set count 1
      }
      channel set $channel mondgesicht_count $count
      
      putquick "privmsg $channel :Punkt Punkt Komma Strich - Fertig ist das MONDGESICHT \\o/ - das hat $time Sekunden lang gedauert - Ihr braucht immer... Wir Bots sind viel schneller (:!"
      putquick "privmsg $channel :Das Mondgesicht Nr. $count hier im Chan wurde von [join $::mond(nicks,$channel) ", "] erstellt!"

      set ::mond(flood,$channel) 1
      timer 1 [list unset ::mond(flood,$channel)]

      unset ::mond(hosts,$channel)
      unset ::mond(nicks,$channel)
      unset ::mond(status,$channel)
   }
}

putlog "Mondgesicht.loaded"
Back to top
View user's profile Send private message
Madalin
Master


Joined: 24 Jun 2005
Posts: 310
Location: Constanta, Romania

PostPosted: Sun Mar 31, 2013 12:17 pm    Post subject: Reply with quote

Have you activated the script on your channel?

.chanset #channl +mondgesicht

Use that command in dcc chat
_________________
https://github.com/MadaliNTCL - To chat with me: https://tawk.to/MadaliNTCL
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
ein7opf
Voice


Joined: 16 Aug 2006
Posts: 19

PostPosted: Sun Mar 31, 2013 12:25 pm    Post subject: Reply with quote

That works!
THANKS A LOT!
All my other scripts are controlled by commands in the channel.
Now I know that!
Should I erease this thread?
Back to top
View user's profile Send private message
Madalin
Master


Joined: 24 Jun 2005
Posts: 310
Location: Constanta, Romania

PostPosted: Sun Mar 31, 2013 1:38 pm    Post subject: Reply with quote

Yes well this script uses dcc chat control. It can be made to be activated using a public command but it needs another script for that Smile, and no you don`t need to delete this.
_________________
https://github.com/MadaliNTCL - To chat with me: https://tawk.to/MadaliNTCL
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
ein7opf
Voice


Joined: 16 Aug 2006
Posts: 19

PostPosted: Sun Mar 31, 2013 4:33 pm    Post subject: Reply with quote

alright, thanks Smile
but there is one thing i miss. I played this game in other chans. And there are stats. After every moon face the bot posts a top10 with nicks and points. Is there a way to integrate that? This would be very nice Smile))
Back to top
View user's profile Send private message
ein7opf
Voice


Joined: 16 Aug 2006
Posts: 19

PostPosted: Mon Apr 01, 2013 8:57 am    Post subject: Reply with quote

stats look like this:


[14:44:29] [ Score: 1. Nick1 (649), 2. Nick2 (518), 3. Nick3 (322), 4. Nick 4 (206), 5. Nick5 (150), 6. Nick6 (129), 7. Nick 7 (116), 8. Nick8 (108), 9. Nick9 (106), 10. Nick10 (103)

I changed original nicks to nick1, nick2 ....
the nicks are underlined and the number of the rank is in fat.
the points are in bracketes. every user gets one point per moonface he was working on with the other players.

EDIT: The timer function is not needed!
Back to top
View user's profile Send private message
ein7opf
Voice


Joined: 16 Aug 2006
Posts: 19

PostPosted: Tue Apr 09, 2013 7:58 am    Post subject: Reply with quote

any idea? i tried to write this part on my own ... but no chance -.-
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