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.

change nick script

Old posts that have not been replied to for several years.
Locked
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

change nick script

Post by Ofloo »

i set the nick in the n-cache file but it won't connect to irc i guesing it isn't reading the nick properly .. ?

Config file:

Code: Select all

set varnick {
  set readnick "[open "cach/n-cache" "r"]"
  set varnick "[read $readnick]"
  close $varnick
}

set nick "$varnick"
set realname "$varnick"
set botnet-nick "$varnick"
Script:

Code: Select all

bind PUB m !setnick setnick:pub

proc setnick:pub {nick uhost hand chan arg} {
global botnick
  set botnick me
  set oldnick [lindex $arg 0]
  set newnick [lindex $arg 1]
  if {$me == "$botnick"} {
      set writenick [open "cache/n-cache" "w"]
      puts -nonewline $writenick $newnick 
      close $writenick
      rehash
      putquick "NOTICE $nick :Botnick succesfully changed"
  }
}
XplaiN but think of me as stupid
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Re: change nick script

Post by Papillon »

Ofloo wrote:Config file:

Code: Select all

set varnick {
  set readnick "[open "cach/n-cache" "r"]"
  set varnick "[read $readnick]"
  close $varnick
}

set nick "$varnick"
set realname "$varnick"
set botnet-nick "$varnick"
1. you should use gets instead of read
2. you are closing the wrong var....
3. no need for the "'s enclosing the brackets
Elen sila lúmenn' omentielvo
Locked