mIRC Home    About    Download    Register    News    Help

Print Thread
#129660 08/09/05 07:49 AM
Joined: Aug 2005
Posts: 32
R
r_alien Offline OP
Ameglian cow
OP Offline
Ameglian cow
R
Joined: Aug 2005
Posts: 32
I have YBBot as my IRC script, but i have modded it a bit! ^_^ But there is one small problem, with certain member names in the search the script returns $2 instead of the username! blush Here is an example:
Quote:
[17:44:03] alien-: !seen Lord_LACN
[17:44:04] hawk: $2 was last seen quiting 9mins 13secs ago with the message: "Ping timeout".
[17:44:12] alien-: !seen Lord_S3H
[17:44:13] hawk: Lord_S3H has not been seen by me, maybe i need my eyes checked.
[17:44:17] alien-: !seen Lord_LACN
[17:44:18] hawk: $2 was last seen quiting 9mins 27secs ago with the message: "Ping timeout".
[17:44:23] alien-: !seen Psycho
[17:44:24] hawk: Psycho was last seen quiting 1hr 24mins 33secs ago with the message: "Quit: <censored> -_-".
[17:44:24] hawk: Psycho's last action was: *Psycho licks GoddessLaura
[17:44:46] alien-: !seen Remco-
[17:44:47] hawk: Remco- was last seen quiting 10hrs 28mins 3secs ago with the message: "Quit: :: brb ::".
[17:44:48] hawk: Remco-'s last action was: *Remco- is back after 21h29m: teh gone
[17:45:12] alien-: !seen Lord_LaCN
[17:45:13] hawk: $2 was last seen quiting 10mins 23secs ago with the message: "Ping timeout".
[17:45:33] alien-: !seen adhlssu07
[17:45:34] hawk: $2 was last seen quiting 32mins 7secs ago with the message: "Ping timeout".
[17:45:51] alien-: !seen ThirtySeven
[17:45:53] hawk: ThirtySeven was last seen quiting 6mins 2secs ago with the message: "Quit: <censored>, gotta run".
[17:45:53] hawk: ThirtySeven's last action was: *ThirtySeven laughs at laura for this one


Here is the code in the seen script:
Code:
on 1500:text:*sn*:#:{ 
  if ($1 == %c $+ sn) {
    if ($2 == on) { .enable #sen | .enable #sjsen | set %se.s on | set %st.sn on | .msg $chan 5The Seen Mode Has Been Enabled, To See If Someone Has Been Here, Type: %c $+ seen &lt;nickname&gt; | set %last.used.command sn on | set %last.person $nick | halt }
    if ($2 == off) { .disable #sen | .disable #sjsen | set %se.s off | set %st.sn off | .msg $chan 5The Seen Mode Has Been Disabled. | set %last.used.command sn off | set %last.person $nick | halt }
  }
  else { halt }
}
on 1500:text:*seclear*:#: {
  if ($1 == %c $+ seclear) { /write -c ini\users.ini | .msg $nick 5All seen files have been cleared. | set %last.used.command seclear | set %last.person $nick }
  else { halt }
}
#sen on
on 1:text:*seen*:#: {
  if ($1 == %c $+ seen) {
    set %hp.chan $chan
    if ($2 == $null) { .msg %hp.chan 5Correct Usage: %c $+ seen &lt;nick&gt; | halt }
    if ($2 == $me) { .msg %hp.chan 5Of course I'm here $nick $+.  YOU TOOL! | halt }
    if ($2 == $nick) { .msg %hp.chan 5Yes, you moron, you are here. | halt }
    if ($2 ison $chan) { .msg %hp.chan 5 $2 could be anywhere, even in your roof, ready to kill you! :o And  $+ $2 is in this channel at the same time. SO WATCH OUT! :P | halt }
    if ($readini ini\users.ini $2 date == $null) { .msg %hp.chan 5 $+ $2 has not been seen by me, maybe i need my eyes checked. | halt }
    else { 
      if ($readini ini\users.ini $2 me == $null) { 
        if ($readini ini\users.ini $2 part == yes) { .msg %hp.chan  5 $+ $2 was last seen parting [ $readini ini\users.ini $2 chan ]  $+ $duration($calc($ctime($fulldate)-$ctime($readini ini\users.ini $2 date))) ago. }
        else { .msg %hp.chan [ 5 $+ $2 ] was last seen quiting  $+ $duration($calc($ctime($fulldate)-$ctime($readini ini\users.ini $2 date))) ago with the message: " $+ [ $readini ini\users.ini $2 message ] $+ ". }
      }
      else { 
        if ($readini ini\users.ini $2 part == yes) { .msg %hp.chan  5 $+ $2 was last seen parting [ $readini ini\users.ini $2 chan ]  $+ $duration($calc($ctime($fulldate)-$ctime($readini ini\users.ini $2 date))) ago. | .msg %hp.chan 5 $+ $2 $+ 's last action was: 6 $+ [ $readini ini\users.ini $2 me ] } 
        else { .msg %hp.chan 5 $+ $2 was last seen quiting  $+ $duration($calc($ctime($fulldate)-$ctime($readini ini\users.ini $2 date))) ago with the message: " $+ [ $readini ini\users.ini $2 message ] $+ ". | .msg %hp.chan 5 $+ $2 $+ 's last action was: 6 $+ [ $readini ini\users.ini $2 me ] }
      }
    }
    else { halt }
  }
}
#sen end
#sjsen on
on 1:QUIT:/writeini -n ini\users.ini $nick date $fulldate | writeini -n ini\users.ini $nick part no | writeini -n ini\users.ini $nick message $1-
on 1:PART:#:/writeini -n ini\users.ini $nick date $fulldate | writeini -n ini\users.ini $nick chan $chan | writeini -n ini\users.ini $nick part yes
on 1:ACTION:*:#:writeini -n ini\users.ini $nick me * $+ $nick $1-
#sjsen end


Can anyone help me so that instead of $2, the script actually returns the name from the search?

#129661 08/09/05 08:00 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
seems a little odd

locate any where its occuring and replace the $2 with [ $2 ] that should do it, for some reason it looks like the $+ in front of the $2 is being applied prior to the $2 being evaluatated, the [ ] tells mirc specificly what to evaluate first.

#129662 08/09/05 08:02 AM
Joined: Jul 2003
Posts: 655
Fjord artisan
Offline
Fjord artisan
Joined: Jul 2003
Posts: 655
else { .msg %hp.chan [ 5 $+ $2 ] was last seen quiting  $+ $duration($calc($ctime($fulldate)-$ctime($readini ini\users.ini $2 date))) ago with the message: " $+ [ $readini ini\users.ini $2 message ] $+ ". }

Remove the square braces.


"Allen is having a small problem and needs help adjusting his attitude" - Flutterby
#129663 08/09/05 08:37 AM
Joined: Aug 2005
Posts: 32
R
r_alien Offline OP
Ameglian cow
OP Offline
Ameglian cow
R
Joined: Aug 2005
Posts: 32
Thanks Om3n, that solved the problem! grin


Link Copied to Clipboard