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 

[SOLVED]Join msg

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
Fire-Fox
Master


Joined: 23 Sep 2006
Posts: 270
Location: /dev/null

PostPosted: Fri Oct 19, 2007 3:26 pm    Post subject: [SOLVED]Join msg Reply with quote

hey

i have a problem

Can enyone tell my why it's nor working...

Code:
##################################################
#       Set user defined flag for users          #
##################################################

setudef flag UserSearch
setudef flag AdminSearch

package require mysqltcl

bind join - * join:aliasfm
bind rejn - * join:aliasfm
######################
### URL to the site ###
#######################
set site_add "http://aliasfm.net"
  ##################
### Mysql path ###
##################
# SQL info
set sql(host) "xxxxxxxx"
set sql(user) "xxxxx"
set sql(pass) "xxxx"
set sql(db) "abot"
set sql(port) "3306"

######################
### URL to the site ###
#######################

set site_add "http://aliasfm.net "

##################
### Mysql path ###
##################
if {![info exists db_handle] } {
set db_handle [mysqlconnect -host $sql(host) -user $sql(user) -password $sql(pass) -db $sql(db) -port $sql(port)]
}

##################################
### Define The Channels On IRC ###
##################################
set chan_(mainchan)     "#aliasfm"

#############################
### Some Global Variables ###
#############################

### Set to 1 if you want the join msg enabled
set globals_(join) "1"

##########################
### Find The UserClass ###
##########################
proc bt.class { class id } {

switch $class {

          #"0"         {set class "0User" }
                  "5"        {set class "4Live DJ" }
                  "10"        {set class "4Chat Chef" }
                  "default"   {set class "Not Found" }
          }

return $class
}


###########################################
### Greeting MSG When User Join channel ###
###########################################
proc bt.join.class { chan nick class} {

switch $class {

   ### The number is the number of the class on the site
   ### "return 0" means no msg for that class
   #"0"        {putserv "PRIVMSG $chan :10Velkommen Til 7:::9 $nick 7:::9 10Vores Outlaw" }
   "5"       {putserv "PRIVMSG $chan :10Velkommen Til 7:::9 $nick 7:::9 10Vores Live Dj" }
   "default"  {set class "Not Found" }
 }
}
#################
### Join Proc ###
#################
proc join:aliasfm {nick host hand chan} {
global botnick db_handle globals_ error_ help_ chan_
 
  if {$nick != $botnick} {
 
    set chan [string tolower $chan]
    if {[channel get $chan UserSearch]} {
   
       if {[mysqlping $db_handle] != 1} {
             putserv "PRIVMSG $chan : $error_(mysqllost)"
             return 0
       }
       
       set sqlnick "SELECT userid FROM nicks WHERE nick='[mysqlescape $nick]'"
       set resultnick [mysqlquery $db_handle $sqlnick]
             
       set nicki 0
       while {[set record [mysqlnext $resultnick]] != ""} {
         set userid [lindex $record 0]
         incr nicki
       }
             
       if { $nicki == 0 } { return 0 }
             
       if { $userid == "" } { return 0 }
             
       set sql "SELECT username, class FROM users WHERE id='[mysqlescape $userid]'"
       
       set result [mysqlquery $db_handle $sql]
             
       set i 0
       while {[set record [mysqlnext $result]] != ""} {
                   
         set username [lindex $record 0];
         set class [lindex $record 1];
       }
       
       if { $globals_(help) == 1 } {putserv "notice $nick : $help_(join)"}
       if { $globals_(join) != 1 } { return 0 }
       
       set sql "SELECT username, class FROM users WHERE id='[mysqlescape $userid]'"
       set result [mysqlquery $db_handle $sql]
             
       set i 0
       while {[set record [mysqlnext $result]] != ""} {
                   
         set username [lindex $record 0];
         set class [lindex $record 1];
       }
       mysqlendquery $result
       
       bt.join.class $chan $nick $class

    }
  }
}

_________________
GreatZ
Fire-Fox | Denmark

Scripts: Relay | Store Text | TvMaze


Last edited by Fire-Fox on Mon Jun 24, 2013 7:20 am; edited 2 times in total
Back to top
View user's profile Send private message MSN Messenger
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Fri Oct 19, 2007 8:22 pm    Post subject: Reply with quote

You do have mysqltcl setup?

Also, have you contacted the author?
_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
Fire-Fox
Master


Joined: 23 Sep 2006
Posts: 270
Location: /dev/null

PostPosted: Sat Oct 20, 2007 9:56 am    Post subject: Reply with quote

Alchera wrote:
You do have mysqltcl setup?

Also, have you contacted the author?


How can i check the mysqltcl is working....

And the author, is one i know that has setup another bot with the same funktion, but he is to busy to help at the moment Smile
_________________
GreatZ
Fire-Fox | Denmark

Scripts: Relay | Store Text | TvMaze
Back to top
View user's profile Send private message MSN Messenger
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Sat Oct 20, 2007 6:29 pm    Post subject: Reply with quote

Because the script is not working I'd assume that you do not have mysqltcl installed.

The script looks for that package.
Code:
package require mysqltcl

Fire-Fox wrote:
How can i check the mysqltcl is working....

Your answer is might be here: http://forum.egghelp.org/viewtopic.php?p=76869&highlight=#76869
_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
Fire-Fox
Master


Joined: 23 Sep 2006
Posts: 270
Location: /dev/null

PostPosted: Sun Oct 21, 2007 7:18 am    Post subject: Reply with quote

Alchera wrote:
Because the script is not working I'd assume that you do not have mysqltcl installed.

The script looks for that package.
Code:
package require mysqltcl

Fire-Fox wrote:
How can i check the mysqltcl is working....

Your answer is might be here: http://forum.egghelp.org/viewtopic.php?p=76869&highlight=#76869


thanks so fare Smile
Okay i'll gtry to look into it... with some root access on the server.... Smile

Can i use this one... ?
http://barkerjr.net/irc/eggdrop/modules/

Quote:
MySQL
This module is really a tool for script developers who want to access a MySQL database without an extra Tcl module. This module may be required by certain scripts. A is also available. For an example script, see MySeen in the scripts section of this site.

_________________
GreatZ
Fire-Fox | Denmark

Scripts: Relay | Store Text | TvMaze
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help 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