|
Joined: May 2022
Posts: 78
Babel fish
|
OP
Babel fish
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
|
|
|
|
Joined: May 2022
Posts: 78
Babel fish
|
OP
Babel fish
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 I mean something like:
on *:JOIN:#Alessandra: {
if (MindUser* iswm $nick) {return}
if ($nick == NOT REGISTERED or IDENTIFIED) { return }
if ($nick == REGISTERED or IDENTIFIED) { mode # +v $nick }
}
|
|
|
|
Joined: Feb 2011
Posts: 462
Pan-dimensional mouse
|
Pan-dimensional mouse
Joined: Feb 2011
Posts: 462 |
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:
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 }
}
}
|
|
|
|
Joined: May 2022
Posts: 78
Babel fish
|
OP
Babel fish
Joined: May 2022
Posts: 78 |
It perfecty works sir. Really thanks a lot and all my best for You P.S.: I stil didn't get about raw XXX rule... I need to study more Thanks again
|
|
|
|
Joined: May 2022
Posts: 78
Babel fish
|
OP
Babel fish
Joined: May 2022
Posts: 78 |
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:
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
|
|
|
|
Joined: Jan 2012
Posts: 323
Pan-dimensional mouse
|
Pan-dimensional mouse
Joined: Jan 2012
Posts: 323 |
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.
|
|
|
|
Joined: May 2022
Posts: 78
Babel fish
|
OP
Babel fish
Joined: May 2022
Posts: 78 |
|
|
|
|
Joined: May 2022
Posts: 78
Babel fish
|
OP
Babel fish
Joined: May 2022
Posts: 78 |
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:
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"
|
|
|
|
Joined: Feb 2011
Posts: 462
Pan-dimensional mouse
|
Pan-dimensional mouse
Joined: Feb 2011
Posts: 462 |
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
}
}
}
|
|
|
|
Joined: May 2022
Posts: 78
Babel fish
|
OP
Babel fish
Joined: May 2022
Posts: 78 |
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.
|
|
|
|
Joined: Jan 2012
Posts: 323
Pan-dimensional mouse
|
Pan-dimensional mouse
Joined: Jan 2012
Posts: 323 |
Try using my variant of the script 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".
|
|
|
|
Joined: May 2022
Posts: 78
Babel fish
|
OP
Babel fish
Joined: May 2022
Posts: 78 |
[quote=Epic]Try using my variant of the script 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.
else [b][color:#FF0000].timerwarn 1 60[/color][/b] .notice $2 Please, register/identify Your nick! Thanks
|
|
|
|
Joined: Jan 2012
Posts: 323
Pan-dimensional mouse
|
Pan-dimensional mouse
Joined: Jan 2012
Posts: 323 |
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: 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.
|
|
|
|
Joined: Nov 2021
Posts: 117
Vogon poet
|
Vogon poet
Joined: Nov 2021
Posts: 117 |
Would this be usefull Epic to check if nick is actually a chan founder/admin/op/hop/ or already voiced ?
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
|
|
|
|
Joined: May 2022
Posts: 78
Babel fish
|
OP
Babel fish
Joined: May 2022
Posts: 78 |
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 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
|
|
|
|
Joined: May 2022
Posts: 78
Babel fish
|
OP
Babel fish
Joined: May 2022
Posts: 78 |
Would this be usefull Epic to check if nick is actually a chan founder/admin/op/hop/ or already voiced ?
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
|
|
|
|
Joined: Jan 2012
Posts: 323
Pan-dimensional mouse
|
Pan-dimensional mouse
Joined: Jan 2012
Posts: 323 |
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.
|
|
|
|
Joined: Jan 2012
Posts: 323
Pan-dimensional mouse
|
Pan-dimensional mouse
Joined: Jan 2012
Posts: 323 |
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:
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.
|
|
|
|
Joined: Jul 2006
Posts: 4,182
Hoopy frood
|
Hoopy frood
Joined: Jul 2006
Posts: 4,182 |
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
|
|
|
|
Joined: Nov 2021
Posts: 117
Vogon poet
|
Vogon poet
Joined: Nov 2021
Posts: 117 |
oh yes i forgot to edit the timer for join event thanks Epic for the correction.
|
|
|
|
|