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.

script change msg to pub

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
w
whittinghamj
Op
Posts: 103
Joined: Sun May 21, 2006 4:50 pm

script change msg to pub

Post by whittinghamj »

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: Select all

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
User avatar
krimson
Halfop
Posts: 86
Joined: Wed Apr 19, 2006 8:12 am

Post by krimson »

Code: Select all

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.
w
whittinghamj
Op
Posts: 103
Joined: Sun May 21, 2006 4:50 pm

Post by whittinghamj »

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
User avatar
krimson
Halfop
Posts: 86
Joined: Wed Apr 19, 2006 8:12 am

Post by krimson »

i edited my previous post and changed the code
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

Code: Select all

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 :P
Post Reply