mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: May 2005
Posts: 30
Z
Zedrick Offline OP
Ameglian cow
OP Offline
Ameglian cow
Z
Joined: May 2005
Posts: 30
I have made some IRC Operator commands on a bot, to use on the IRCXpro Server, and I need help with the login to the bot to use the IRC Operator commands.


I am using a set password that everyone will all use.




This is how it works :-


the bot is not in any rooms


/msg bot login password

--- bot will userhost the person and add their address to the IRC-OPERATOR userlist and write the address into a file

--- When the person leaves the network, the bot will read from the file and remove the person off the userlist




I need help with the $read -- $remove -- and the userhost (raw 302) $gettok


with the $read - to match the address in the snotice client exiting notice that the bot gets --$5 is the address in the snotice --- something like - if ($5 isin $read(IRC-Operator.txt %login-nick[[address]])) ruser %login-nick[[address]]

-SERVER- *** Client exiting: Zedrick (~Zedrick@host) ()




$remove - to remove the ( ) in the address to get the address




with $gettok in the userlist - how do I make the *!* $+ @ $+ $gettok($2,2,64) to get *!ident@host ?

userhost: Zedrick=+~Zedrick@host

--- $gettok($2,2,64) shows the host without it saying *!*@host



Code:
 on 1:TEXT:login *:?: {
  if (password isin $2) { userhost $nick | set %login $true | set %login-nick $nick } 
  else { .notice $nick Wrong Password | halt }
}



raw 302:*:{
  if (%login) {
    write IRC-Operator.txt *!* $+ @ $+ $gettok($2,2,64)
    auser IRC-OPERATOR *!* $+ @ $+ $gettok($2,2,64)
    .notice %login-nick Password Accepted - you can now use the IRC Operator commands
    .notice %login-nick type in /msg $me help to see the list of IRC Operator commands
    unset %login-nick
    set %login-nick[[address]] *!* $+ @ $+ $gettok($2,2,64)
  }
}



on *:SNOTICE:*Client exiting*: {
  if ($5 isin $read(IRC-Operator.txt %login-nick[[address]])) ruser %login-nick[[address]]
} 

Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
if ($5 iswm $read(whatever.txt,n)) {
bleh
}

also your using gettok 64 ( // 2) you need ( // 1) which is 32

ex:. //echo -a $gettok(hello *!*User@host.com,2,32) will show *!*User@host.com because the 2 word is that and you dont need text cut from it

otherwise //echo -a $gettok(hello *!*User@host.com,2,64)
probably returns @host.com or host.com

$remove((ident@user.com),$chr(40),$chr(41))

in the above remove example i put the text for you to test like //echo -a $remove((ident@user.com),$chr(40),$chr(41))

to show you how to remove the brackets you need to associate a chr command removal so it can be example $remove($5,$chr(40),$chr(41))

make sure you know the Parenthese rule if your gonna open one make sure you close it... mostly common script mistakes is a bracket mismatch or ( ) < is not open and closed properly

BAD: $remove($5,$chr(40),%chr(41)

GOOD: $remove($5,$chr(40),$chr(41))

if we break it down to see it better what i mean is

$remove( $5 , $chr ( 40 ) , $chr ( 41 ) )

so i would add a varible to strip $5's ( ) then use this variable later to /ruser ident@host.com

hope this helps


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: May 2005
Posts: 30
Z
Zedrick Offline OP
Ameglian cow
OP Offline
Ameglian cow
Z
Joined: May 2005
Posts: 30
Hi Lpfix5


I am having great difficulty trying to get *!ident@host (( *! $+ ~Zedrick@host )) from the userhost -- userhost: Zedrick=+~Zedrick@host


Quote:

//echo -a $gettok(hello *!*User@host.com,2,32) will show *!*User@host.com


--- that is for when you type in yourself hello *!*User@host.com,2,32 or *!*User@host.com,1,32 will show *!*User@host.com -- it does not work on the userhost




Quote:

if ($5 iswm $read(whatever.txt,n)) {
bleh
}


--- with the read, I tried putting in ~Zedrick@host into the IRC-Operator.txt file and it does not read it and remove the userlist




[code]
on *:SNOTICE:*Client exiting*: {
$remove($5,$chr(40),$chr(41))
set %login-nick[[address]] $5
if (%login-nick[[address]] iswm $read(IRC-Operator.txt,n)) {
ruser %login-nick[[address]]
unset %login-nick[[address]]
}
}

Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
i forgot its $read(whatever.txt,nw,%variable)

the variable being whatever you what to read from file

as for the gettok on that user@host.com ill get back to you im sick right and cant think out of my mind its something simple has a regml but i cant think of the right commands


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: May 2005
Posts: 30
Z
Zedrick Offline OP
Ameglian cow
OP Offline
Ameglian cow
Z
Joined: May 2005
Posts: 30

I Have Done It
Works Perfect smile



I did a google on mIRC userhost $gettok and found it in the first page listed -- http://mirc.stealth.net/tutorials/debug.html
--- further down the page


[email]ident@host[/email]
$gettok($2-,2-,$asc($left($gettok($2-,2,61),1)))

*! $+ $gettok($2-,2-,$asc($left($gettok($2-,2,61),1)))
to get it to work




Thank You for the help Lpfix5
-- hope you get better soon



Code:
 
on 1:TEXT:login *:?: {
  if (password isin $2) { userhost $nick | set %login $true | set %login-nick $nick } 
  else { notice $nick Wrong Password | halt }
}



raw 302:*:{
  if (%login) {
    write IRC-Operator.txt *! $+ $gettok($2-,2-,$asc($left($gettok($2-,2,61),1)))
    auser IRC-OPERATOR *! $+ $gettok($2-,2-,$asc($left($gettok($2-,2,61),1)))
    .notice %login-nick Password Accepted - you can now use the IRC Operator commands
    .notice %login-nick type in /msg $me help to see the list of IRC Operator commands
    unset %login-nick
  }
}



on *:SNOTICE:*Client exiting*: {  
  set %login.address *! $+ $remove($5,$chr(40),$chr(41))
  if ($read(IRC-Operator.txt,nw,%login.address)) {
    ruser %login.address | write -d IRC-Operator.txt %login.address
    unset %login.address
  }
}
 


Link Copied to Clipboard