Scripting question

  • Hey - turns out IRC is out and something a little more modern has taken it's place... A little thing called Discord!

    Join our community @ https://discord.gg/JuaSzXBZrk for a pick-up game, or just to rekindle with fellow community members.

Hardcore

(Taki)
Jun 8, 2001
3,631
63
Germany
When a user with a certain nickname joins a (certain) chan,
i want to send him a private message with lets say 5 seconds delay.

How can i script this? (btw the delay is only a nice to have and the certain chan, too)
Atm i can only script it like this (example) as i dunno anything about mirc scripting:
Code:
on 1:JOIN:#aakserver:{
	 { /msg Katsch fo nap }
}
But this will send the message over and over to Katsch whenever someone joins #aakserver! And of course will also try to send when Katsch isn't even there.

I tried it this way (googled a bit *)
Code:
on 1:JOIN:#aakserver:{
	 if ( $nick == Katsch ) 
	 { msg $nick fo nap }
}
but i get "* /if: insufficient parameters"

* i thought this could work because in google i found:
"on 1:JOIN:#Testraum:{ if ($nick != $me) { msg $chan Hi $nick } }"
but that doesn't work either when i adapt it and test it...


[
btw it works when i use "if ( %test == hello )" where %test is 'hello'.
so is my problem that $nick is not set ?
]
 
thx! a step forward i think.
[btw what does "*" instead of "1" do?]
but now it messages to every nick that joins :(

maybe because i get " IF($NICK Unknown command " ? :(
and if i put spaces between "if" and "(" and also between "(" and "$nick" i get:
" * /if: insufficient parameters " again :(

btw this works too
Code:
on *:JOIN:#aakserver:{
  if($nick == katsch){
  msg $nick fo nap }
}
(so no need for the variable i think?)

i am using mirc 6.16 btw


edit: hehe farakkk i just used that as an example. wanna use it for *cough* something else :rolleyes:
 
heh sorry if it's not working as it should. Last time i was playing with mIRC scripting was in 1998 so i think i forgot many things :)
 
no solution then? :(

hm okay maybe what i wanna do can be done with a timer, too.
i read about timers in mirc script but didn't understand it very well i think.

how could i script something that ... lets say... executes "/takimessage" every 5 minutes ( where "/takimessage" is for example { /msg #aak fo naps } ) ?
 
As far as i can remember, timers goes like this:
timer <number of times to run, 0 for infinite> <delay in seconds> <string>
Its been a while since i used mirc, so i dont know if i remember correctly
 
Just had a quick look over your original code, it looks ok to me :confused:

I had sth similar in place once to flash my mirc window when someone specific joined any channel.

Code:
ON *:JOIN:#:{
  if ($nick == Somen00b) || ($nick == sn00b) || ($nick == n0rbert) {
	flash -b n00b online!
  }
}

Just make sure when referencing global channels like that you put it in another remote script, away from any other channel references like that (since it will override others, or others will override it).

Timers are pretty simple to use really... I guess what you want is sth like this:

Code:
ON *:JOIN:#:{
  if ($chan == #aakserver) && ($nick == sn00b) {
	.timermsgn00b 0 5 /query $nick Lo n00b!
  }
}
 
a) :rofl: n0rbert :thumb:

big thx!
it works now. i think it was because:

1)
in my version(s) i didn't put the "{" (the one before "msg ...") in the same line as the "if"-command. that was why it said "not enuf parameters".
2) and it seems that, when i tried it brajan's way, i must (still after fixing the first few spaces) have done something wrong with the spaces (maybe the space between ")" and "{" ! ).

Right?


b) gonna try that timer now :)