mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
#272582 20/04/24 04:05 PM
Joined: May 2022
Posts: 78
F
Fernet Offline OP
Babel fish
OP Offline
Babel fish
F
Joined: May 2022
Posts: 78
Hello. I'd like to have an addon that give a temporary voice (+v) on join in a channel (i.e.: #test), but only if that nick is registered and identified on the net (MindForge).
Thanks

Fernet #272584 21/04/24 08:35 AM
Joined: May 2022
Posts: 78
F
Fernet Offline OP
Babel fish
OP Offline
Babel fish
F
Joined: May 2022
Posts: 78
Originally Posted by Fernet
Hello. I'd like to have an addon that give a temporary voice (+v) on join in a channel (i.e.: #test), but only if that nick is registered and identified on the net (MindForge).
Thanks

I mean something like:
Code
on *:JOIN:#Alessandra: {
  if (MindUser* iswm $nick) {return}
  if ($nick == NOT REGISTERED or IDENTIFIED) { return }
  if ($nick == REGISTERED or IDENTIFIED) { mode # +v $nick }
}

Fernet #272586 23/04/24 06:05 PM
Joined: Feb 2011
Posts: 461
K
Pan-dimensional mouse
Offline
Pan-dimensional mouse
K
Joined: Feb 2011
Posts: 461
It looks like you would need to /whois the person when they join the channel in order to get their login status.

Could try this script:

Code
on *:join:#Alessandra:{
  if ($network == MindForge) {
    if (MindUser* iswm $nick) { return }
    whois $nick
  }
}
; User is logged in, +v them.
; :Unixverse.MindForge.org 330 TestNick KindOne KindOne :is logged in as
raw 330:*:{
  if ($network == MindForge) {
    if ($2 ison #Alessandra) { mode #Alessandra +v $2 }
  } 
}

KindOne #272591 25/04/24 12:33 PM
Joined: May 2022
Posts: 78
F
Fernet Offline OP
Babel fish
OP Offline
Babel fish
F
Joined: May 2022
Posts: 78
It perfecty works sir. Really thanks a lot and all my best for You wink
P.S.: I stil didn't get about raw XXX rule... I need to study more
Thanks again

KindOne #272665 01/06/24 12:18 PM
Joined: May 2022
Posts: 78
F
Fernet Offline OP
Babel fish
OP Offline
Babel fish
F
Joined: May 2022
Posts: 78
Originally Posted by KindOne
It looks like you would need to /whois the person when they join the channel in order to get their login status.

Could try this script:

Code
on *:join:#Alessandra:{
  if ($network == MindForge) {
    if (MindUser* iswm $nick) { return }
    whois $nick
  }
}
; User is logged in, +v them.
; :Unixverse.MindForge.org 330 TestNick KindOne KindOne :is logged in as
raw 330:*:{
  if ($network == MindForge) {
    if ($2 ison #Alessandra) { mode #Alessandra +v $2 }
  } 
}

I noticed the whois is printed in active windows. If i add echo -s so to have --->.echo -s whois $nick will be printed only in status, right?
Thanks

Fernet #272666 01/06/24 08:48 PM
Joined: Jan 2012
Posts: 323
Pan-dimensional mouse
Offline
Pan-dimensional mouse
Joined: Jan 2012
Posts: 323
Originally Posted by Fernet
I noticed the whois is printed in active windows. If i add echo -s so to have --->.echo -s whois $nick will be printed only in status, right?
No. This way you will receive an echo message with the string "whois", which will be displayed in the status window.

To display the information received by the "/whois" command in the status window, can change the mIRC settings: "Options/IRC" -> "Show in active" -> uncheck the box "Whois" -> OK.


🌐 http://forum.epicnet.ru 📜 irc.epicnet.ru 6667 #Code | mIRC scripts, help, discuss, examples
Epic #272667 02/06/24 07:39 AM
Joined: May 2022
Posts: 78
F
Fernet Offline OP
Babel fish
OP Offline
Babel fish
F
Joined: May 2022
Posts: 78
Ok. Thanks sir

KindOne #272711 20/06/24 12:09 PM
Joined: May 2022
Posts: 78
F
Fernet Offline OP
Babel fish
OP Offline
Babel fish
F
Joined: May 2022
Posts: 78
Originally Posted by KindOne
It looks like you would need to /whois the person when they join the channel in order to get their login status.

Could try this script:

Code
on *:join:#Alessandra:{
  if ($network == MindForge) {
    if (MindUser* iswm $nick) { return }
    whois $nick
  }
}
; User is logged in, +v them.
; :Unixverse.MindForge.org 330 TestNick KindOne KindOne :is logged in as
raw 330:*:{
  if ($network == MindForge) {
    if ($2 ison #Alessandra) { mode #Alessandra +v $2 }
  } 
}

What to add if I want to send a message (notice) to that user not registered/identified i.e.: "Please , register/identify Your nick! Thanks"

Fernet #272712 20/06/24 02:56 PM
Joined: Feb 2011
Posts: 461
K
Pan-dimensional mouse
Offline
Pan-dimensional mouse
K
Joined: Feb 2011
Posts: 461
Code
on *:join:#Alessandra:{
  if ($network == MindForge) {
    if (MindUser* iswm $nick) { return }
    whois $nick
  }
}

; Beginning of whois.
; Set a global variable on the nick.
raw 313:*:{
  if ($network == MindForge) { 
    if ($2 ison #Alessandra) { 
      set %reg_check_ $+ $2 1
    }
  }
}

; User is logged in, +v them and unset the global variable.
; :Unixverse.MindForge.org 330 TestNick KindOne KindOne :is logged in as
raw 330:*:{
  if ($network == MindForge) {
    if ($2 ison #Alessandra) {
      mode ##test +v $2
      unset %reg_check_ $+ $2
    }
  } 
}
; End of whois.
; If the nick is not registered message them and unset the global variable.
raw 318:*:{
  if ($network == MindForge) {
    if (($2 ison #Alessandra) && (%reg_check_ $+ $2)) { 
      .msg $2 Please, register/identify Your nick! Thanks 
      unset %reg_check_ $+ $2
    }     
  }
}

KindOne #272714 21/06/24 07:31 AM
Joined: May 2022
Posts: 78
F
Fernet Offline OP
Babel fish
OP Offline
Babel fish
F
Joined: May 2022
Posts: 78
Originally Posted by KindOne
Code
on *:join:#Alessandra:{
  if ($network == MindForge) {
    if (MindUser* iswm $nick) { return }
    whois $nick
  }
}

; Beginning of whois.
; Set a global variable on the nick.
raw 313:*:{
  if ($network == MindForge) { 
    if ($2 ison #Alessandra) { 
      set %reg_check_ $+ $2 1
    }
  }
}

; User is logged in, +v them and unset the global variable.
; :Unixverse.MindForge.org 330 TestNick KindOne KindOne :is logged in as
raw 330:*:{
  if ($network == MindForge) {
    if ($2 ison #Alessandra) {
      mode ##test +v $2
      unset %reg_check_ $+ $2
    }
  } 
}
; End of whois.
; If the nick is not registered message them and unset the global variable.
raw 318:*:{
  if ($network == MindForge) {
    if (($2 ison #Alessandra) && (%reg_check_ $+ $2)) { 
      .msg $2 Please, register/identify Your nick! Thanks 
      unset %reg_check_ $+ $2
    }     
  }
}

This send message also if a nick is registered / identified. Maybe because to identify takes about 20 sec. Maybe is better to set a timer on whois?

Last edited by Fernet; 21/06/24 12:36 PM.
Fernet #272717 21/06/24 08:43 PM
Joined: Jan 2012
Posts: 323
Pan-dimensional mouse
Offline
Pan-dimensional mouse
Joined: Jan 2012
Posts: 323
Try using my variant of the script code:
Code
alias -l my_channel { return #Alessandra }

on *:JOIN:$($my_channel):{
  if ($network == MindForge && *MindUser* !iswm $nick) { .enable #CHECKUSERS | whois $nick }
}

#CHECKUSERS off
raw *:*:{
  if ($numeric == 312 && *MindForge* iswm $1-) { .hadd -m cu-network $2 $true }
  if ($numeric == 330) { .hadd -m cu-logged $2 $true }
  if ($numeric == 318) {
    if ($hget(cu-network,$2)) {
      if ($hget(cu-logged,$2)) {
        if ($2 ison $my_channel) mode $my_channel +v $2
      }
      else .notice $2 Please, register/identify Your nick! Thanks
    }
    .hdel -sw cu-network $2 | .hdel -sw cu-logged $2 | .disable #CHECKUSERS
  }
  haltdef
}
#CHECKUSERS end


To simplify, it is enough to indicate the channel name only in the alias "my_channel".


🌐 http://forum.epicnet.ru 📜 irc.epicnet.ru 6667 #Code | mIRC scripts, help, discuss, examples
Epic #272718 22/06/24 05:55 AM
Joined: May 2022
Posts: 78
F
Fernet Offline OP
Babel fish
OP Offline
Babel fish
F
Joined: May 2022
Posts: 78
[quote=Epic]Try using my variant of the script code:
Code
      else .notice $2 Please, register/identify Your nick! Thanks

I wonder if is possible to set a timer in this line: on connect there's an initialization that need about 20 seconds. So an user may skip the warn.

Code
      else [b][color:#FF0000].timerwarn 1 60[/color][/b] .notice $2 Please, register/identify Your nick! Thanks

Fernet #272719 22/06/24 03:35 PM
Joined: Jan 2012
Posts: 323
Pan-dimensional mouse
Offline
Pan-dimensional mouse
Joined: Jan 2012
Posts: 323
Originally Posted by Fernet
I wonder if is possible to set a timer in this line: on connect there's an initialization that need about 20 seconds. So an user may skip the warn.
Hmm... It is not entirely clear what could be causing such a long initialization. Logically, the script should work immediately after the bot enters the channel, and should immediately check all users joining the channel. This should not cause any lag unless it depends on the settings/load of the IRCd network you are on or if your bot is using too many complex unoptimized scripts that are causing some lag. In this case, you can try moving this script higher in the run order list. Also, to check, try running this script on pure mIRC without other installed scripts.

And of course you can try adding a timer to send a notice message to each user. Only for correct operation, you need to add the user's nickname $2 to the name of the timer so that the name is unique and the timer is independent from other similar working timers:
Code
else .timerCU_WARN $+ $2 1 20 .notice $2 Please, register/identify Your nick! Thanks

I hope this helps you and you find a solution to the problem, because when I tested the script, everything worked quickly, without any delays.


🌐 http://forum.epicnet.ru 📜 irc.epicnet.ru 6667 #Code | mIRC scripts, help, discuss, examples
Epic #272720 22/06/24 05:34 PM
Joined: Nov 2021
Posts: 115
Vogon poet
Offline
Vogon poet
Joined: Nov 2021
Posts: 115
Would this be usefull Epic to check if nick is actually a chan founder/admin/op/hop/ or already voiced ?

Code

Alias CheckAccess {   if (!$nick($1,$2,~&@%+)) { .enable #CHECKUSERS | whois $2  } }

alias -l my_channel { return #Alessandra }

on *:JOIN:$($my_channel):{
 if (!$Timer($+($1,.,$2,.,CheckOP,.,$network)) && $network == MindForge && *MindUser* !iswm $nick) { 
    .timer $+ $+($1,.,$2,.,CheckOP,.,$network) -m 1 800 CheckAccess $unsafe($chan) $nick 
 }
}

 
#CHECKUSERS off
raw *:*:{
  if ($numeric == 312 && *MindForge* iswm $1-) { .hadd -m cu-network $2 $true }
  if ($numeric == 330) { .hadd -m cu-logged $2 $true }
  if ($numeric == 318) {
    if ($hget(cu-network,$2)) {
      if ($hget(cu-logged,$2)) {
        if ($2 ison $my_channel) mode $my_channel +v $2
      }
      else .notice $2 Please, register/identify Your nick! Thanks
    }
    .hdel -sw cu-network $2 | .hdel -sw cu-logged $2 | .disable #CHECKUSERS
  }
  haltdef
}
#CHECKUSERS end


Epic #272721 22/06/24 06:06 PM
Joined: May 2022
Posts: 78
F
Fernet Offline OP
Babel fish
OP Offline
Babel fish
F
Joined: May 2022
Posts: 78
Quote
Hmm... It is not entirely clear what could be causing such a long initialization.

Simply because many users have t join in so many channels laugh
Or maybe their scripts have to load other addons. Not mine. But I noticed there're scripts who takes also 30secs to be full working. Of course a "naked" mIRC doesn't has this problem.
As always thanks a lot sir. I'll try everything

Simo #272722 22/06/24 06:07 PM
Joined: May 2022
Posts: 78
F
Fernet Offline OP
Babel fish
OP Offline
Babel fish
F
Joined: May 2022
Posts: 78
Originally Posted by Simo
Would this be usefull Epic to check if nick is actually a chan founder/admin/op/hop/ or already voiced ?

Code

Alias CheckAccess {   if (!$nick($1,$2,~&@%+)) { .enable #CHECKUSERS | whois $2  } }

alias -l my_channel { return #Alessandra }

on *:JOIN:$($my_channel):{
 if (!$Timer($+($1,.,$2,.,CheckOP,.,$network)) && $network == MindForge && *MindUser* !iswm $nick) { 
    .timer $+ $+($1,.,$2,.,CheckOP,.,$network) -m 1 800 CheckAccess $unsafe($chan) $nick 
 }
}

 
#CHECKUSERS off
raw *:*:{
  if ($numeric == 312 && *MindForge* iswm $1-) { .hadd -m cu-network $2 $true }
  if ($numeric == 330) { .hadd -m cu-logged $2 $true }
  if ($numeric == 318) {
    if ($hget(cu-network,$2)) {
      if ($hget(cu-logged,$2)) {
        if ($2 ison $my_channel) mode $my_channel +v $2
      }
      else .notice $2 Please, register/identify Your nick! Thanks
    }
    .hdel -sw cu-network $2 | .hdel -sw cu-logged $2 | .disable #CHECKUSERS
  }
  haltdef
}
#CHECKUSERS end


I'll try it too Thanks a lot sir

Fernet #272723 22/06/24 07:23 PM
Joined: Jan 2012
Posts: 323
Pan-dimensional mouse
Offline
Pan-dimensional mouse
Joined: Jan 2012
Posts: 323
Originally Posted by Fernet
I noticed there're scripts who takes also 30secs to be full working ...
This is a very long period of time, and it shouldn’t be like that, especially when it comes to security scripts that should work instantly. Only if the specifics of the script require such a long delay or if it is an infotainment script, then such long delays are acceptable. You need to optimize/fix all your scripts, disable something, change something, shorten or combine so that they execute quickly, ranging from milliseconds to 1-2 seconds. Of course, everything is at your discretion, these are just useful recommendations.


🌐 http://forum.epicnet.ru 📜 irc.epicnet.ru 6667 #Code | mIRC scripts, help, discuss, examples
Simo #272724 22/06/24 07:52 PM
Joined: Jan 2012
Posts: 323
Pan-dimensional mouse
Offline
Pan-dimensional mouse
Joined: Jan 2012
Posts: 323
Originally Posted by Simo
Would this be usefull Epic to check if nick is actually a chan founder/admin/op/hop/ or already voiced ?
Yes, this can be useful if you need to give the user joining a channel a short time to get/set the channel mode (~&@%+) before the "whois" check starts.

Only in the code you provided there are several errors with identifiers $1 and $2, which do not allow to correctly obtain the necessary data.
In the event handler "ON JOIN" this should be $chan and $nick, and in the alias these are already passed parameters, which will be designated as $1 and $2.

Taking into account your suggestions, I made changes to the script code:
Code
alias -l my_channel { return #Alessandra }
alias -l check_access { if (!$nick($1,$2,!~&@%+)) { .enable #CHECKUSERS | whois $2 } }

on !*:JOIN:$($my_channel):{
  if ($network == MindForge && *MindUser* !iswm $nick) {
    .$+(timerACCESS,$network,$chan,$nick) -m 1 1500 check_access $unsafe($chan $nick)
  }
}

#CHECKUSERS off
raw *:*:{
  if ($numeric == 312 && *MindForge* iswm $1-) { .hadd -m cu-network $2 $true }
  if ($numeric == 330) { .hadd -m cu-logged $2 $true }
  if ($numeric == 318) {
    if ($hget(cu-network,$2)) {
      if ($hget(cu-logged,$2)) {
        if ($2 ison $my_channel) mode $my_channel +v $2
      }
      else .notice $2 Please, register/identify Your nick! Thanks
      .hdel -sw cu-network $2 | .hdel -sw cu-logged $2
    }
    .disable #CHECKUSERS
  }
  haltdef
}
#CHECKUSERS end

I have set the timer value to "1500" milliseconds, you can change this to another value. Psss: 1 sec = 1000 ms.


🌐 http://forum.epicnet.ru 📜 irc.epicnet.ru 6667 #Code | mIRC scripts, help, discuss, examples
Fernet #272725 22/06/24 08:35 PM
Joined: Jul 2006
Posts: 4,180
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,180
There's a small mistake in the code provided by Kindone replace
&& (%reg_check_ $+ $2))
with
&& ($($+(%,reg_check_,$2),2)))


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Epic #272726 22/06/24 11:13 PM
Joined: Nov 2021
Posts: 115
Vogon poet
Offline
Vogon poet
Joined: Nov 2021
Posts: 115
oh yes i forgot to edit the timer for join event thanks Epic for the correction.

Page 1 of 2 1 2

Link Copied to Clipboard