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.

botnick regain tcl

Old posts that have not been replied to for several years.
Locked
T
THUGNATURE
Voice
Posts: 13
Joined: Tue Apr 08, 2003 9:14 am

botnick regain tcl

Post by THUGNATURE »

hi there can someone reccomend me a good botnick regain tcl i have searched the tcl archive and have had no luck in finding anything if you can help me please provide me with a link or a code that regains the botnick thx in advance
s
spock
Master
Posts: 319
Joined: Thu Dec 12, 2002 8:40 pm

Post by spock »

set keep-nick 1
.set nick NICK-YOU-WANT-TO-"STEAL"-HEHE

this will temporarily change nick. will last until bot is restarted/rehashed.
photon?
g
guppy
eggdrop engineer
Posts: 199
Joined: Mon Sep 24, 2001 8:00 pm
Location: Canada
Contact:

Post by guppy »

I recommend a small tcl script to speed up the process also.

Code: Select all

proc fastregain {} {
  utimer 5 fastregain
  if {$::server != "" && ![isbotnick $nick]} {
    putquick "ISON $::botnick $::nick $::altnick
  }
}

# now start the regain process
fastregain
User avatar
caesar
Mint Rubber
Posts: 3777
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Are you sure about the ![isbotnick $nick] thing? Should not it be ![isbotnick $::nick]? Just asking..
Once the game is over, the king and the pawn go back in the same box.
User avatar
GodOfSuicide
Master
Posts: 463
Joined: Mon Jun 17, 2002 8:00 pm
Location: Austria

Post by GodOfSuicide »

caesar wrote:Are you sure about the ![isbotnick $nick] thing? Should not it be ![isbotnick $::nick]? Just asking..
btw : whats the difference between $var, $::var and ${var} ?
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

$var and ${var} are the same.

You use the {} method, when you need to place text together, eg.

Code: Select all

set var "$varthis sting"
set var "${var}this string"
YOu can see clearly hwo this is used, to provide exact control over names. It is also needed in situation where you use a - in the variable name. EG.

Code: Select all

set this-var 15
set thatvar 20
expr ${this-var}-$thatvar
Without it, you can see the issue. This - issue is a little more deeper than this, and you should use {} whenever there is a - in the var name.

The :: is to do with namespaces. I sugest reading up about namespaces in the Tcl man pages, but you should see hwo this works.

At any 1 time, you can access a command or variable from any namespace, using the fully qualified name. This is irispective of the command or variable scope.

The global namespace is called ::. That should give you a hint as to why you use ::.

With variable scope, you have to import a global variable to use its existing value

Code: Select all

set a "test"
proc test {} {
  global a
  puts stdout $a
}
Because usign the fully qualified name doesn't care about scope, you don't need to import it.

Code: Select all

set a "test"
proc test {} {
  puts stdout $::a
}
The added benefit of this is long winded code segments. You can clearly distinguish between global and local variables, and it saves jumping to the start of the proc, just to import a variable.
User avatar
GodOfSuicide
Master
Posts: 463
Joined: Mon Jun 17, 2002 8:00 pm
Location: Austria

Post by GodOfSuicide »

ok, thanks...

now i can see clearly
Locked