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 

Invite script

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive
View previous topic :: View next topic  
Author Message
FiskerEnDK
Voice


Joined: 16 Jan 2003
Posts: 17

PostPosted: Sat May 03, 2003 11:38 am    Post subject: Invite script Reply with quote

Hi
i have made this script with a friend...
its made to make an invite list..
add/del/invite command
from a database named site_invite.db

but it dosent work.. and we have spend about 24 hours just to try to debug
can anybody help me getting this to work..

best regards
Thomas

<code>
set active "#channel"
set db scripts/site_invite.db

bind msg - @user user
bind msg - @invite invite

putlog "Script loaded: invite"

proc user {nick uhost hand chan args} {
global active db
if {$active != $chan} { return 0 }
set args [split [cleanarg $args]]
set what [lindex $args 0]
if { $what == $add } {
db_load
set user [lindex $args 1]
set pass [lindex $args 2]
if { $user == "" || $pass == "" } {
putserv "NOTICE $nick :Error no username or password set"
putserv "NOTICE $nick :Usage: @user add <username> <password>"
return 0
}
if ([db_search $user]==-1) {
lappend info [list $user $pass]
db_save
putserv "PRIVMSG $chan :\0034=¤ INVITE ¤=\003\ $user is added to userlist by $nick"
return 0
}
}
if { $what == del } {
db_load
set user [lindex $arg 1]
if ([db_search $nom]!=-1) {
db_del [db_search $user]
db_save
putserv "PRIVMSG $chan :\0034=¤ INVITE ¤=\003\ $user is deletede from userlist by $nick."
return 0
}
putserv "NOTICE $nick : $user was not found in the database. Use \"@user list\" to list all users."
return 0
}
if { $what == list } {
db_load
set j 0
set listusers ""
for { set i 0 } { $i<[llength $info] } { incr i } {
lappend listusers [lindex [lindex $info $i] 0]
incr j
}
putserv "NOTICE $nick : $listusers "
return 0
}
}

proc invite { nick uhost hand chan arg } {
global active db
if {$active != $chan} { return 0 }
db_load
set user [lindex $arg 0]
set pass [lindex $arg 1]
if ([sites_search $user]!=-1) {
if (($user == [lindex $info 0]) && ($pass == [lindex $info 1])) {
putserv "PRIVMSG $chan :\0034=¤ INVITE ¤=\003\ invited: $nick from account $user"
putserv "invite $nick $chan"
}
return 0
}
if ([sites_search $user]!=-1) {
if (($user != [lindex $info 0]) || ($pass != [lindex $info 1])) {
putserv "NOTICE $nick :\0034=¤ INVITE ¤=\003\ Wrong username or password !!!!"
putserv "PRIVMSG $chan :\0034=¤ INVITE ¤=\003\ $nick tried to join #Chan"
}
return 0
}
if ([sites_search $user]==-1) {
putserv "NOTICE $nick :\0034=¤ INVITE ¤=\003\ Wrong username or password !!!!"
putserv "PRIVMSG $chan :\0034=¤ INVITE ¤=\003\ $nick tried to join #Chan"
}
}

proc db_save { } {
global db info
set fichier [open $db w]
puts $fichier $info
close $fichier
}

proc db_del { index } {
global db info
set info [lreplace $db $index $index]
}

proc db_load { } {
global db
set fichier [open $db r]
gets $fichier info
close $fichier
}

proc db_search { user pass } {
global info
for { set i 0 } { $i<[llength $info] } { incr i } {
if ![string compare [string tolower [lindex [lindex $info $i] 0]] [string tolower $user]] {
return $i
}
}
return -1
}
</code>
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive 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