mIRC Home    About    Download    Register    News    Help

Active Threads | Unanswered Past 24 hours | Past 48 hours | Past Week | Past Month | Past Year
Scripts & Popups Jump to new posts
Re: Random Issue maroon 4 hours ago
You can use the 'goto' command to go to a label, which is a text string beginning with a colon. You could do something like:

====
if ( $rand(1,2) ) == 1 goto goodbean
else goto badbean

:badbean
code goes here
goto label123

:goodbean
code goes here
goto label123

:label123
code goes here
==========
obviously, you didn't need the "goto badbean" since that label was on the next line. and same goes for the goto at the end of the goodbean code.

You can simplify your script by keeping your messages either in separate text files, or in a hashtable. hashtable has the advantage of being kept in memory, so you don't need a disk read each time. text file has the advantage of being easy to /play the text file and see a list of all your messages.

Also, the $read command has the random feature built into it, when you don't give it a line number to read. This example uses the 'n' switch because that prevents any word beginning with $ or % from being replaced by how they evaluate. i.e. a line in the text file containing $me would print the literal "$me" instead of using your nick.

var %message $read(goodbean.txt,nt) $+ 1,0Enjoy The Bean

This fills a variable with a random line from the text file. This way you don't need to keep adjusting your script each time you add another message. Notice how I appended the final portion of the 'good bean' message, so you don't need to put that on every line of the text. If you find it harder to put the Ctrl+K symbol into the text file when using something like notepad, you can choose a character that will never be used in any of your messages, and use that in place of the color code. For example, assume the character will be the asterisk, the text file would contain lines like:

Black Pepper *15,1( *4Black*15 *4Pepper*15 )
Garlic *30,1( *4Garlic*30 )

and then you can fetch random lines like this, while changing the asterisk back to the Ctrl+K symbol:

msg %beanch Hands %victem a $replace($read(badbean.txt,nt),*,$chr(3)) $+ 1,0 Ohhh You've Been BeanBoozeled

After you read a random line, if you need to know which line was most recently read from any disk file, the line number is contained in $readn

Something else you should change in your script is that your variables are being created as global variables which continue to be saved in your vars tab of the scripts editor long after your script is used, even though they aren't needing to be saved for later. You can make them be local by either using /set -l or using /var

var %victem $nick
var %beanch #PoulsKitchen


It looks like
set -kl %badcount + 1
is supposed to be a counter for how many times the bad routine has been hit. By using the -l flag, this creates the variable as a local variable which doesn't exist outside the ON TEXT event. What this is doing is defining the variable as the literal string "+ 1". If you want to increment a global variable, you can do it like: /inc %badcount
1 24 Read More
Scripts & Popups Jump to new posts
Re: Help Needed for a Script. *please* Epic Yesterday at 06:53 AM
I read your request and decided to try writing my own script, and this is what I got cool
3 types of protective checks for flooding, installation and automatic removal of the mode on the channel and kick on the bully's nickname.
All control in the alias "af_data". You can enable and disable different types of verification separately, as well as adjust the number of actions and the number of seconds after which need to respond.

Code
#####################################################################
#   AntiFlood v1.0
#   Description: Catching different types of flood on channels
#   Author: Epic
#####################################################################

alias af_data {
  .hadd -m af check-mess true
  .hadd -m af check-rep true
  .hadd -m af check-words true
  .hadd -m af check-mode true
  .hadd -m af check-kick true
  ;---------------------------
  .hadd -m af max-mess 5
  .hadd -m af max-mess-sec 3
  .hadd -m af max-rep 3
  .hadd -m af max-rep-sec 10
  .hadd -m af max-words 200
  .hadd -m af max-words-sec 10
  .hadd -m af mode +m
  .hadd -m af demode -m
  .hadd -m af mode-sec 300
  .hadd -m af reason flood/spam
}
====================================================
alias afcheck {
  var %af_check count- $+ $1 $+ $2
  if ($prop == rep) return $hget(af_rep,%af_check)
  if ($prop == rsec) return $hget(af_rsec,%af_check)
  if ($prop == mes) return $hget(af_mess,%af_check)
  if ($prop == msec) return $hget(af_msec,%af_check)
  if ($prop == words) return $hget(af_words,%af_check)
  if ($prop == wsec) return $hget(af_wsec,%af_check)
}
alias af_count_mes {
  var %af_count count- $+ $1 $+ $2
  if (!$hget(af_msec,%af_count)) .hadd -mz af_msec %af_count $hget(af,max-mess-sec)
  if (!$hget(af_mess,%af_count)) .hadd -mu $+ $hget(af,max-mess-sec) af_mess %af_count 0
  if ($hget(af_msec,%af_count) > 0) .hinc -m af_mess %af_count 1
}
alias af_count_rep {
  var %af_count count- $+ $1 $+ $2
  if (!$hget(af_rsec,%af_count)) || ($3- !isin $hget(af_rep_text,%af_count)) {
    .hadd -mz af_rsec %af_count $hget(af,max-rep-sec)
    .hadd -mu $+ $hget(af,max-rep-sec) af_rep %af_count 0
    .hadd -m af_rep_text %af_count $3-
  }
  else { .hinc -mu $+ $hget(af,max-rep-sec) af_rep %af_count 1 }
}
alias af_count_words {
  var %af_count count- $+ $1 $+ $2
  if (!$hget(af_wsec,%af_count)) .hadd -mz af_wsec %af_count $hget(af,max-words-sec)
  if (!$hget(af_words,%af_count)) .hadd -mu $+ $hget(af,max-words-sec) af_words %af_count 0
  if ($hget(af_wsec,%af_count) > 0) .hinc -m af_words %af_count $numtok($3-,32)
}
====================================================
on *:TEXT:*:#:{
  af_data | var %af_count count- $+ $nick $+ $chan
  if ($hget(af,check-mess) == true) af_count_mes $nick $chan
  if ($hget(af,check-rep) == true) af_count_rep $nick $chan $1-
  if ($hget(af,check-words) == true) af_count_words $nick $chan $strip($1-)

  ;# Debug check script echo
  ;/echo -s 28debug:18 $nick $chan 28 message:53 $hget(af_mess,%af_count) $hget(af_msec,%af_count) 28 repeat:41 $hget(af_rep,%af_count) $hget(af_rsec,%af_count) 28 words:29 $hget(af_words,%af_count) $hget(af_wsec,%af_count)

  if ($afcheck($nick,$chan).mes >= $hget(af,max-mess) && $afcheck($nick,$chan).msec > 0) {
    /echo -a FLOOD $chan $nick :40 $afcheck($nick,$chan).mes messages in40 $hget(af,max-mess-sec) seconds.
    if ($hget(af,check-mode) == true) af_mode_chan $nick $chan
    if ($hget(af_mess,%af_count)) .hdel -sw af_mess count-* | if ($hget(af_msec,%af_count)) .hdel -sw af_msec count-*
  }
  if ($afcheck($nick,$chan).rep >= $hget(af,max-rep) && $afcheck($nick,$chan).rsec > 0) {
    /echo -a FLOOD $chan $nick :40 $afcheck($nick,$chan).rep reps in40 $hget(af,max-rep-sec) seconds.
    if ($hget(af,check-mode) == true) af_mode_chan $nick $chan
    if ($hget(af_rep,%af_count)) .hdel -sw af_rep count-* | if ($hget(af_rsec,%af_count)) .hdel -sw af_rsec count-*
  }
  if ($afcheck($nick,$chan).words >= $hget(af,max-words) && $afcheck($nick,$chan).wsec > 0) {
    /echo -a FLOOD $chan $nick :40 $afcheck($nick,$chan).words words in40 $hget(af,max-words-sec) seconds.
    if ($hget(af,check-mode) == true) af_mode_chan $nick $chan
    if ($hget(af_words,%af_count)) .hdel -sw af_words count-* | if ($hget(af_wsec,%af_count)) .hdel -sw af_wsec count-*
  }
}
====================================================
alias af_mode_chan {
  if ($hget(af,check-kick) == true) /kick $2 $1 $hget(af,reason)
  if (!$timer(AF $+ $2)) {
    /mode $2 $hget(af,mode)
    .timerAF $+ $2 1 $hget(af,mode-sec) /mode $2 $hget(af,demode)
  }
}
====================================================
1 126 Read More
Bug Reports Jump to new posts
Re: $regml().pos $regmlex().pos maroon Yesterday at 02:17 AM
This behavior will be difficult to script around. The $2 parm requires a byte offset, but the .pos property returns a character offset. So, a script will be able to do $bvar(&binvar,$regml(foo,1).pos,length) to handle the match string only if the binvar contains only codepoints 1-127. When dealing with binvars, it would be helpful to have a $regml().bytepos property so the script can know the match's actual offset in the &binvar.

And, with returning offsets smaller than the $2 parm will also be confusing for addressing the binvar, so scripts will be forced to copy the section of binvar to a new binvar, into which they would search at offset 1.
2 106 Read More
Scripts & Popups Jump to new posts
Re: dll errors when clicking custom toolbar maroon Yesterday at 01:48 AM
You'd need to hope there's someone out there who uses this dll, which I've never heard of. A dll is like a collection of 1-or-more identifiers or commands wrapped up inside an external binary. Hopefully you have some documentation telling you which procedure names are inside the dll, and hopefully the docs tell you the syntax of how to use them.

The procedures inside the dll are similar to alias names inside the dll which can do things a scripted alias can't do by itself, and the procedures need to be called in their exact case-sensitive name. You can call them like a command, as in:

/dll filename.dll procedurename this is the $1- for the procedure
or
//echo -a $dll(filename.dll,procedurename,this is the $1- for the procedure)

We'll have a hard time helping you when your problem is that, not only are you not feeding the $1- to the dll's procedure, you're not even passing the name of the procedure either.

edit: if you have trouble figuring out that dll, perhaps better luck with spopup.dll http://www.xise.nl/mirc/
3 64 Read More
Scripts & Popups Jump to new posts
Re: Need help to include separators Epic 19/09/20 03:55 PM
Can you please tell me if there are any working (help files) or sites with full help information and examples on how to work with this DLL correctly?
2 114 Read More
Bug Reports Jump to new posts
Re: /setlayer sets 0 if not using a number. maroon 18/09/20 11:49 PM
For this command, evaluating text as if 0 can make it difficult to get back into your client after this scripting error.

//var %setting 128 | !setlayer %setting $chan(1) | timer -o 1 10 !setlayer 255

If the 128 is deleted, the $null %variable causes the first setlayer command to be seen as "setlayer #channel" which is evaluated as if "setlayer 0" against the main window.
2 148 Read More
Bug Reports Jump to new posts
mIRC beta Khaled 18/09/20 06:59 PM
The latest beta can be downloaded here and includes these changes:

Quote
Beta v7.63.478 changes:
1.Item 9, updated.
Changed the behaviour of the Connect/Options/Ports/Bind feature:
If you enter an adapter name, mIRC will always search for a
matching adapter to find its current IP address. If you enter an
IP address, it will always use that IP address.
2.Item 11, https://forums.mirc.com/ubbthreads.php/topics/267739
Needs testing.
3.Item 12, updated.

Beta v7.63.416 changes:
1.Item 1, https://forums.mirc.com/ubbthreads.php/topics/267596
2.Item 2, https://forums.mirc.com/ubbthreads.php/topics/267574
3.Item 3, https://forums.mirc.com/ubbthreads.php/topics/267624
4.Item 4, https://forums.mirc.com/ubbthreads.php/topics/267637
5.Item 5, extended. Added to end of the LOADINFO structure. DLLs
need to check the version number to determine if it is present.
6.Item 6, https://forums.mirc.com/ubbthreads.php/topics/267642
7.Item 7, fixed.
8.Item 8, fixed.
9.Item 9, https://forums.mirc.com/ubbthreads.php/topics/267723
10.Item 10, changed.

Changes:
1.Fixed /bcopy not copying zero length binary variables.
2.Fixed /timer -h multimedia timer bug that caused imprecise elapsed
time measurement at low millisecond intervals.
3.Fixed $bfind() N parameter not being applied during a .regex search.
4.Fixed $min()/$max() parsing bug.
5.Extended the DLL LOADINFO structure to include a DWORD dBytes
variable that specifies the maximum number of bytes allowed when
writing to the data and parms strings.
6.Fixed /timer halted message not being displayed in some cases.
7.Fixed DDE server not being reset when DDE settings changed in the
Options DDE dialog.
8.Fixed SSL private key error incorrectly being reported as an
SSL certificate error in some contexts.
9.Fixed bind to adapter/IP address bug that prevented it from using
adapters with dynamic IP addresses.
10.Changed $base() to remove limit on floating point precision for
larger bases.
11.Fixed $base() not rounding fractions to current base.
12.Updated LibZip library to v1.7.3.
1 189,699 Read More
mIRC Help Jump to new posts
Re: nick changes beaston 18/09/20 09:20 AM
Ok, will give it a shot.
2 90 Read More
mIRC Help Jump to new posts
Re: mIRC Languages Epic 18/09/20 08:39 AM
Multi-language support for options and messages in mIRC

[Linked Image from i.ibb.co]

Many users have difficulty understanding English when configuring client options.
Is there a chance that someday there will be multilingual support in options and messages in the mIRC client?

This task can be greatly facilitated by providing such a translation option for users themselves through a language file.
Let's say: "mircdir/language/en_US.lang". This file can contain all the texts for options and messages in windows, with the help of which you can easily create your own file in your native and understandable language.
For example, copy a file in English and create your own file with the name: "ru_RU.lang" - translate all texts into Russian in it, and then it can be connected to the client in the options for translation into your language.

This will greatly facilitate the use of the client for many users around the world, raise it to a new level, and also greatly simplify the life of the developers of their project and scripts.
1 347 Read More
Scripts & Popups Jump to new posts
Re: script for repeating characters gabriel_ 17/09/20 02:23 AM
Thank you very much, it was what I needed! Thank you!! grin grin
4 187 Read More
mIRC Help Jump to new posts
Re: Enter colored text maroon 16/09/20 03:35 PM
When you're logged in, click on the triangle next to your userid in the upper right corner. In the popup window, click on the 'message balloon' icon right below your nick.

Also, once you find 1 post of yours, you can click on your nick in the left margin.
5 144 Read More
mIRC Help Jump to new posts
Re: Lock options missing maroon 16/09/20 03:40 AM
Have a look at https://en.wikichip.org/wiki/mirc/msl_injection for some examples of things to watch out for in scripts. Some of these issues are caused simply by people writing their own scripts in a careless manner, but these things can be found in publicly available scripts that people innocently don't know have these types of problems. While the scripts work perfectly fine when used as intended, you must be careful about how you use timers, specifically in how you use text not created by you. As you can see from these examples, even $calc could be used against you in a limited context.

You can create aliases to defend against some of the built-in /commands, but not against $identifiers. However, the ! prefix would make even this defense pointless. For example, "run" was one of the commands on the old list being blocked. You could make this alias which would intercept a script trying to use "run something", and would block it unless it did "run password something". However, if they used "!run something" it would execute the built-in identifier without checking for the existence of this alias, in the same way this alias evades another alias created to alter the format of the /echo command.

run {
!if ($1 != password) { !echo -a halt: attempt to use /run command without password! | !halt }
!run $2-
}

Some of the other things on the old "block" list were identifiers, which you can't intercept using an alias. You create an "alias decode" to intercept "/decode parameters", but it can't intercept "$decode(parameters)".
2 90 Read More
Feature Suggestions Jump to new posts
Re: $dllcall Sat 15/09/20 06:20 PM
Originally Posted by maroon
If backwards compatibility needs to be preserved with current behavior of the $1- for the callbackalias, perhaps a better solution would be a new $callbackstring kind of identifier which would contain the normal return3 string.

Yes, I have to say I misunderstood your original second point. It would definitely be good if there were a way (any way!) for the custom alias of a $dllcall() call to obtain the data value returned from the DLL.
3 139 Read More
Bug Reports Jump to new posts
Re: $base fraction rounding maroon 14/09/20 08:36 PM
yes, thanks
6 211 Read More
Feature Suggestions Jump to new posts
Re: Bind to specific Network Interface / Adapter Khaled 14/09/20 05:56 PM
I was just testing the latest beta with different combinations of network adapters/binds and it is still not doing what it should be doing. I should have this fixed in the next beta :-]
5 216 Read More
Feature Suggestions Jump to new posts
Re: /nicklist control Epic 14/09/20 04:01 PM
I don't want to use another client, I like mIRC. But in my opinion, mIRC has long been in need of a significant update to its look and feel to compete with other IRC clients.

There was no request in my post for such an update that would affect the normal appearance of the client, I just suggested creating a logic command for the scripters to help them decorate the client in a more modern design with this command to avoid using third party (curves) DLLs. In any case, everyone who loves minimalism will stay with it with the default client settings.

I understand that this can be difficult to implement, but it needs to be done. This idea should be seen as additional functionality and design enhancement for the mIRC client, and I'm sure many scripters will support me in this.
Hopefully this client support will be officially implemented soon. How and in what format to make this command, I leave it to the discretion of the author.
9 4,215 Read More
Feature Suggestions Jump to new posts
Re: Place all files in one mIRC folder Raccoon 12/09/20 10:44 PM
@TECO Review this technical information to see if it makes more sense. mIRC definitely already does what you want, in more ways than one.

Forums > mIRC Help > mIRC Settings INI, Portable Mode, AppData.
6 197 Read More
Scripts & Popups Jump to new posts
Re: Getting write error - Need assistance Darkmnm 09/09/20 12:32 AM
Yes, Maroon explains it perfectly. Not sure exactly why it is not writing/updating the ini file once it's created. When there is a 2* in the ini file the checkbox in the edit box of the dialog is checked and if I manually change the 2* to a 1* in the ini file then open the dialog the checkbox is now unchecked. For some odd reason there is something in the code I cannot see that is not allowing the write/update to the ini file via the dialog.
10 316 Read More
Bug Reports Jump to new posts
Re: $com issue kap 06/09/20 03:00 PM
Originally Posted by FroggieDaFrog
In short this is not a bug in mIRC, but rather scripter error.


Alright, cheers! Thank you for the information/break down SReject. :-)
5 223 Read More
Bug Reports Jump to new posts
Re: Full Install backups bug JeniSkunk 06/09/20 12:26 PM
Thanks Khaled. smile
I've seen that unlimited backups folders behaviour in older programs as well. Chews up space unnecessarily.
But a limited number of backups folders would be good, for any occasion where a user does 2 or more updates in a very short timeframe, because that's what caught me out.
2 101 Read More
Scripts & Popups Jump to new posts
Re: Need help for an auto morning, afterno, night mess Raccoon 05/09/20 09:17 PM
Code
$gettok(Goedenacht Goedenmorgen Goedenmiddag Goedenavond, $calc($calc($time) *4 //24 +1), 32)
8 187 Read More
Bug Reports Jump to new posts
Re: 7.63 crashing intermittently. Khaled 02/09/20 04:10 PM
Good to hear :-) Thanks for the feedback.
20 504 Read More
Feature Suggestions Jump to new posts
Re: rline and dline for channel/query/status windows kap 02/09/20 01:19 PM
Originally Posted by x64
I have a number of ideas that i would love to implement (e.g. condensing multiple similar lines into one as they occur, condensing JOIN/MODE into one without delaying, etc) but have no way of changing the window text.


*bump*
3 1,648 Read More
Bug Reports Jump to new posts
Re: if statement parsing maroon 01/09/20 06:48 PM
FYI, I encountered something that's related either to this thread or to https://forums.mirc.com/ubbthreads.php/topics/261001/v1-v2-inconsistancy

The $v1 being null relates to the other thread, however it would have been easier to catch if the parenthesis count reaching negative generates an error.

I generally do use parenthesis just because it makes the code easier to read, plus I don't need to remember where they're optional and where they're not. So, I'm more interested in the negative parenthesis count than the other issue. In this example the $v1 is set correctly in the /else condition but is $null in the $true condition

Code
//var %a $rand(0,9) | if $right(%a,1) isin 13579) echo -a $v1 is odd %a | else echo -a $v1 is even %a
//var %a $rand(0,9) | if           %a isin 13579) echo -a $v1 is odd %a | else echo -a $v1 is even %a
//var %a $rand(0,9) | if            3 isin 13579) echo -a $v1 is odd %a | else echo -a $v1 is even %a



Correction: I see now that the $v1 in the $true condition isn't actually $null, it's carried forward from the prior conditional, whether it's a prior if() or while(). Here, when %a is an odd number then $v1 remains as abcd from the prior if()

//var %a $rand(0,9) | if (abcd == defg) noop | if %a isin 13579 echo -a $v1 is odd %a | else echo -a $v1 is even %a
4 531 Read More
Scripts & Popups Jump to new posts
Re: DDE help Khaled 01/09/20 08:27 AM
Quote
Renaming it via the options->other->dde works for me.

It looks like there is an issue where the DDE server settings are not always applied when they are changed in the DDE Options dialog. This has been fixed for the next version.
4 252 Read More
Page 1 of 16 1 2 3 15 16