| View previous topic :: View next topic |
| Author |
Message |
whittinghamj Op
Joined: 21 May 2006 Posts: 103
|
Posted: Wed Sep 13, 2006 10:56 pm Post subject: script change msg to pub |
|
|
Hello everyone.
I have the following script which i need changing from a /msg cmd to a !pub command and locked to one channel.
Here is the /msg script as it is right now.
| Code: |
proc add_1 { nick uhost hand args } {
global chan_1 chan_3 db
set args [split $args " "]
set user [lindex $args 0]
set user [string range $user 1 end]
set pass [lindex $args 1]
set pass [string range $pass 0 end-1]
if { $user == "" || $pass == "" } {
putserv "NOTICE $nick :Please instert a Nickname and a password"
return 0
}
set up $user|$pass
set wfile [open $db a+]
puts $wfile $up
close $wfile
putserv "PRIVMSG $chan_3 :\[\00314DB UPDATE\003\] $user is added to Database by $nick"
}
|
I need it to only be able to work in #nemesis-staff
Thank you for anyone who can help me out with this.
Quest |
|
| Back to top |
|
 |
krimson Halfop

Joined: 19 Apr 2006 Posts: 86
|
Posted: Thu Sep 14, 2006 1:21 am Post subject: |
|
|
| Code: | bind pub n|n "!pub" add_1
proc add_1 {nick uhost hand chan arg} {
global chan_1 chan_3 db
if {$chan != "#nemesis-staff"} {return 0}
set arg [split $arg]
set user [lindex $args 0]
set pass [lindex $args 1]
if {$user = "" || $pass == ""} {
puthelp "NOTICE $nick :Please insert a Nickname and a password"
return 0
}
set up $user|$pass
set wfile [open $db a+]
puts $wfile $up
close $wfile
puthelp "PRIVMSG $chan_3 :\[\00314DB UPDATE\003\] $user is added to Database by $nick"
} |
Last edited by krimson on Thu Sep 14, 2006 5:42 am; edited 1 time in total |
|
| Back to top |
|
 |
whittinghamj Op
Joined: 21 May 2006 Posts: 103
|
Posted: Thu Sep 14, 2006 4:20 am Post subject: |
|
|
Thanks buddy - does not work for me tho :-s
I tried
!pub user|pass
!pub user pass
and even just !pub to get the msg telling me what the syntax in - no reply at all.
I checked to see if the pub name was used elsewhere but its not.
I checked in the DCC windows, no error's.
Any suggestions please buddy?
Cheers
Jamie |
|
| Back to top |
|
 |
krimson Halfop

Joined: 19 Apr 2006 Posts: 86
|
Posted: Thu Sep 14, 2006 5:43 am Post subject: |
|
|
| i edited my previous post and changed the code |
|
| Back to top |
|
 |
metroid Owner
Joined: 16 Jun 2004 Posts: 771
|
Posted: Thu Sep 14, 2006 8:55 am Post subject: |
|
|
| Code: | bind pub n|n "!pub" add_1
proc add_1 {nick uhost hand chan arg} {
global chan_1 chan_3 db
if {$chan != "#nemesis-staff"} {return 0}
set arg [split $arg]
set user [lindex $arg 0]
set pass [lindex $arg 1]
if {$user = "" || $pass == ""} {
puthelp "NOTICE $nick :Please insert a Nickname and a password"
return 0
}
set up $user|$pass
set wfile [open $db a+]
puts $wfile $up
close $wfile
puthelp "PRIVMSG $chan_3 :\[\00314DB UPDATE\003\] $user is added to Database by $nick"
} |
Atleast look at your script before posting it  |
|
| Back to top |
|
 |
|