mIRC Home    About    Download    Register    News    Help

Print Thread
#22075 03/05/03 09:39 AM
Joined: Mar 2003
Posts: 49
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Mar 2003
Posts: 49
I want to build a command that when someone write !seen nick
like
!seen SnakeRulez
and i part the channel 4 menutes ago that the bot write
I seen SnakeRulez 4 minutes ago
and, i bulid a command :
on *:text:*:#:{
if ($1 == !seen) {
if (%now. [ $+ [ $2 ] ] != $null) {
msg $chan The nick $2 is now onlione!
}
if (%seen. [ $+ [ $2 ] ] != $null) {
msg $chan I see the nick $2 before $calc($time - %Seen. [ $+ [ $2 ] ] ) minutes
}
}
}
on *:part:#:{
unset %now. [ $+ [ $nick ] ]
set %Seen. [ $+ [ $nick ] ] $time
}
on *:join:#:{
unset %seen. [ $+ [ $nick ] ]
set %now. [ $+ [ $nick ] ]
}
and when i write !seen SnakeRulez
the bot not answer
please help me please crazy

#22076 03/05/03 10:54 AM
Joined: Jan 2003
Posts: 96
J
Babel fish
Offline
Babel fish
J
Joined: Jan 2003
Posts: 96
So you want your bot to store when you joined/parted and tell the user that used !seen (your nick) ? where you are?
Code:
on *:TEXT:*!seen*:# {
   if (yournick isin $1-) {
   if ($1 ison $chan) { notice $nick hello $2 is right here }
   if ($1 !ison $chan) { notice $nick $2 isnt here, but I last saw him %reason $+ , $asctime( $+ %leavetime $+ ) ago }
 }
}

On *:kick:#:{
  if ($nick == yournick) { set %leavetime $ctime | set %reason get kicked }
}
On *:part:#:{
  if ($nick == yournick) { set %leavetime $ctime | set %reason part }
}
on *:QUIT: {
  if ($nick == yournick) { set %leavetime $ctime | set %reason quit }
}


Small and simple

Yournick is your nickname, not the bots and not $me

Works for your nick only smile
eer "should" work wink

#22077 03/05/03 04:57 PM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Here is a seen script I made a while ago. It uses a hash table to speed up the responce times, and not have to go looking through a very very long file. I uploaded it on my server, so you can get it easily: http://www.kingtomato.com/seen.mrc


-KingTomato
#22078 03/05/03 08:47 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
I hope this is ok.
Code:
on 1:JOIN:#: { writeini Seen.ini Nicks $remember($nick) $time @ $date | halt }
on 1:QUIT:#: { writeini Seen.ini Nicks $remember($nick) $time @ $date | halt }
on 1:PART:#: { writeini Seen.ini Nicks $remember($nick) $time @ $date | halt }
on 1:KICK:#: { writeini Seen.ini Nicks $remember($nick) $time @ $date | halt }
alias -l addseen { return at %tmpp1 }
alias -l remember { if ($exists(Seen.ini) == $false) { write Seen.ini } | return $replace($replace($1,[,_),],_) }

on 1:text:*!seen*:#: {
  if ($strip($1) != !Seen) { halt }
  if ($2 == $null) { msg $chan ( $+ $nick $+ )  you didn't specify a nickname.  | halt }
  if ($2 == $me) { msg $chan ( $+ $nick $+ ) I am here.  | halt }
  if ($2 == $nick) { msg $chan ( $+ $nick $+ ) look in the mirror!  | halt }
  if ($2 ison $chan) { msg $chan ( $+ $nick $+ ) $2 is here, are you blind? | halt }
  unset %tmpp1 
  set %tmpp1 $readini Seen.ini Nicks $remember($2)
  if (%tmpp1 == $null) { msg $chan ( $+ $nick $+ ), no I didn't see $2 $+ . | halt }
  else { 
  msg $chan ( $+ $nick $+ ) I last saw $2 $addseen(%tmpp1) $+ . | halt }
}

#22079 03/05/03 09:47 PM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
that should work, but remember that the more names you have..the longer it takes to find someone. Also, for your $remember() alias, that is redundant. The *.ini file will create itself on the first entry if it doesn't exist, as well as replace ascii that it deems as inappropriate.


-KingTomato
#22080 04/05/03 09:01 AM
Joined: Jan 2003
Posts: 96
J
Babel fish
Offline
Babel fish
J
Joined: Jan 2003
Posts: 96
yeps seen scripts in ini files generally sux, cause they choke your mIRC while huge netsplits/rejoins occurs.


Link Copied to Clipboard