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 

script change msg to pub

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


Joined: 21 May 2006
Posts: 103

PostPosted: Wed Sep 13, 2006 10:56 pm    Post subject: script change msg to pub Reply with quote

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
View user's profile Send private message
krimson
Halfop


Joined: 19 Apr 2006
Posts: 86

PostPosted: Thu Sep 14, 2006 1:21 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
whittinghamj
Op


Joined: 21 May 2006
Posts: 103

PostPosted: Thu Sep 14, 2006 4:20 am    Post subject: Reply with quote

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
View user's profile Send private message
krimson
Halfop


Joined: 19 Apr 2006
Posts: 86

PostPosted: Thu Sep 14, 2006 5:43 am    Post subject: Reply with quote

i edited my previous post and changed the code
Back to top
View user's profile Send private message Send e-mail
metroid
Owner


Joined: 16 Jun 2004
Posts: 771

PostPosted: Thu Sep 14, 2006 8:55 am    Post subject: Reply with quote

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 Razz
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