mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2006
Posts: 95
B
blk Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Feb 2006
Posts: 95
Ok, if ($nick == <nick>) works good,
but I'm afraid to change my nick now...
Then anybody could make their nick into the <nick>...
Is there another way.. like my ip?


-blk-
Joined: Jul 2005
Posts: 56
W
Babel fish
Offline
Babel fish
W
Joined: Jul 2005
Posts: 56
if ($nick == $me) ??

Joined: Feb 2006
Posts: 95
B
blk Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Feb 2006
Posts: 95
Why would I command myself to do something... crazy


-blk-
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
The $me identifier will match whatever nick you're using, so it won't matter if you change nicks. Using an IP address is A) a lot more complicated, and B) not guaranteed. While a lot of connections these days use static IP addresses, not all do.

If you were to set it to match your IP address, and then you disconnected from the internet (for any reason), then the IP address that you get when you reconnect, might not be the same as the one that you had before you disconnected.

Using $me in this situation is, in my opinion, the best way to go.

Joined: Feb 2006
Posts: 95
B
blk Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Feb 2006
Posts: 95
Im using these commands for a bot,
could i make a login script so i could login or out
from one nick and then it would replace the old <nick>'s?

Sounds alittle complicated when you write it down... crazy


-blk-
Joined: Feb 2006
Posts: 95
B
blk Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Feb 2006
Posts: 95
and it would ignore any commands when its logged out...


-blk-
Joined: Jul 2003
Posts: 655
Fjord artisan
Offline
Fjord artisan
Joined: Jul 2003
Posts: 655
for a very quick and basic solution...

on *:TEXT:!log*:?: {
if ($1 == !login) && ($2 == password) { set %loggedin 1}
elseif ($1 == !logout) { set %loggedin 0 }
}

syntax: /msg bot !login <password> OR /msg bot !logout

Where password is the password you must msg the bot in order to login, in your other scripts you can use something like 'if (%loggedin != 1) return' on the first line (under the event opening).

There are many other ways to do it, just showing you a basic example. You could use the mirc user levels, as it would be more efficient in the end. (logging in with correct pass would add you as an X level user, logging out would remove it... then you can prefix events with the X level so they may only be used by a user matching that level).... such a user levels method would also allow for easy setup of multiple bot admin, where as im assuming at the moment you have hard coded restrictions.

Last edited by Om3n; 11/02/06 01:19 PM.

"Allen is having a small problem and needs help adjusting his attitude" - Flutterby
Joined: Feb 2006
Posts: 95
B
blk Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Feb 2006
Posts: 95
When i do that and login, it doesn't let me use the command...
I just get nothing


-blk-
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
on *:TEXT:!login PASSWORD:?: { set %logged.in.nick $nick }
on *:TEXT:!logout:?: { unset %logged.in.nick }
on *:NICK:{ if ($nick == %logged.in.nick) { set %logged.in.nick $newnick }
on *:PART:#:{ if ($nick == %logged.in.nick) { if (!$comchan($nick,0)) { unset %logged.in.nick | msg $nick Due to you leaving all common channels with me I have logged you out } } }
on *:QUIT:{ if ($nick == %logged.in.nick) { unset %logged.in.nick } }


those cover you PMing !login password to login
or PMing !logout to logout
it also covers you changing nicks
you parting all comon channels (auto logout)
and you quiting

Now how to use it.

in any bot event which you want to be the only one (once logged in) to be able to use add this code at the begining
example
Code:
ON *:TEXT:!burp:?:{
  [color:blue]if ($nick == %logged.in.nick) {[/color]
    amsg burp!
  }
}

Joined: Feb 2006
Posts: 95
B
blk Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Feb 2006
Posts: 95
Thats awesome DaveC grin
thanks smile


-blk-
Joined: Jan 2006
Posts: 13
H
Pikka bird
Offline
Pikka bird
H
Joined: Jan 2006
Posts: 13
Quote:
Ok, if ($nick == <nick>) works good,
but I'm afraid to change my nick now...
Then anybody could make their nick into the <nick>...
Is there another way.. like my ip?


IF you're afraid of someone using your nick, then use
/ns set Kill quick for a 20 second kill, in conjuction of that, I made this script, a new identifier, $identified.
Code:
  
alias identified { 
  .raw WHO $$1 
  set -u3 %identnick $$1 
  var %wsh = wsh $+ $ticks, %cmd 
  %cmd = pathping.exe -n -w 1 -q 1 -h 1 -p 1 127.0.0.1 
  .comopen %wsh wscript.shell 
  .comclose %wsh $com(%wsh,run,1,bstr*,% $+ comspec% /c %cmd &gt;nul,uint,0,bool,true) 
  return %identans 
} 
raw 352:*:{ 
  If (%identnick isin $1-) { 
    If (r isin $7) set -u3 %identans $true 
    Else { set -u3 %identans $false } 
    halt 
  } 
} 
raw 315:*:{ 
  If (%identnick) halt 
}


Goes in remotes tab.
Might experience a bit of lag, if raws dont act quick enough.
(Returns boolean, $true or $false.)

Joined: Feb 2006
Posts: 95
B
blk Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Feb 2006
Posts: 95
Where do I put my nick?


-blk-

Link Copied to Clipboard