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
kick ban detect XGamerAMD Yesterday at 09:09 PM
alias meop { if ($me isop $1) || ($me isvoice $1) || ($me isreg $1) return $true }

alias kb {
//echo -a if $meop($chan) { .echo -st 0,4 No Se puede echar | halt }
mode # +b ~q: $+ $1
}

doesnt work any help
0 2 Read More
Scripts & Popups Jump to new posts
Re: ident host problem Sat Yesterday at 04:14 PM
Alternatively: $ial($1).user
3 71 Read More
Bug Reports Jump to new posts
Re: "Always On Top" checks itself Kerashi 05/12/21 09:52 PM
I checked my scripts, and the only one I have doesn't use either of those commands, so I'm fairly sure that's not it. I haven't experienced it again since reporting it, so not sure what was going on. I might have turned it on in the View menu at one point accidentally (not sure), but it struck me as strange how it would turn on again with no intervention after being turned off. Regardless, everything seems to be behaving normally now, thanks for responding.
3 155 Read More
Scripts & Popups Jump to new posts
Re: kickban identical nicks Simo 04/12/21 11:09 AM
thanks talon that does exactly as we expected it to thanks, much apreciated
4 236 Read More
Scripts & Popups Jump to new posts
Re: menu nicklist Epic 02/12/21 01:16 PM
This topic was discussed with author of the question in the IRC chat and a solution was found. The problem has been resolved.
The task was to hide (make inaccessible) a certain menu item, for example the item "Slaps", if the user (You) has no rights "Op" or "Voice" on the channel.

An example of a script for a menu:
Code
menu nicklist,query {
  $iif($menu == nicklist,$iif($meop($chan),Slaps),Slaps)
  .Example Item1
  ..Example Item2: /me tests the fish tail slap on $$1 !!! 8-]
}
alias meop { if ($me isop $1) || ($me isvoice $1) { return $true } }


Perhaps it will be useful for someone else to know and will come in handy in the future, to solve a similar problem.
2 127 Read More
mIRC Help Jump to new posts
Re: Win 11 beta mouseover in taskbar Khaled 02/12/21 09:38 AM
If you are referring to the mIRC button that appears in the Windows taskbar, mIRC has no control over this. The way this works is controlled entirely by Windows, including the mouse-over. It has never been possible to access the mIRC settings through this button.

However, if you have enabled the Tray feature in the mIRC Options/Display/Options/Tray dialog, this will display a small mIRC icon in the Windows tray, at the very right of the Windows taskbar. However, it may be that your Windows 11 is not displaying all application tray icons. You can right-click on the Windows 11 taskbar, select "Taskbar settings" and in the "Taskbar corner overflow" options, you can specify which application icons can appear in the tray area.
1 135 Read More
Scripts & Popups Jump to new posts
Re: dialog help landonsandor 29/11/21 10:52 PM
Thanks. Yeah, I didn't think there was. I looked for an initialize command, but didnt find one. I was able to figure out the drodown menu just fine, and that works.
3 258 Read More
Bug Reports Jump to new posts
$input() doesn't ignore 'o' flag DooMaster 28/11/21 07:16 PM
It seems when using the following $input() combo it returns $yes as it should return $ok

Example:
Code
//echo -a is: $input(title,fvon,titlebar)

0 32 Read More
Feature Suggestions Jump to new posts
Stop writing automatic certificates to Servers.ini favellado 28/11/21 02:47 PM
I have a routine that opens several /sockopen -e in sequence and I notice that mIRC stores the certificates in servers.ini.

The problem is when you put to accept the certificates automatically and mIRC is recording every time in servers.ini for each new request.

This is not cool, especially for HD. My routine works every 3 minutes for multiple https.

mIRC should create a hash table and keep the certificates in memory and when mIRC is closed, at that moment it should save the certificates in servers.ini.

I went to monitor the folder where servers.ini and mirc.ini are, both are updating whenever /sockopen -e comes into action and servers.ini receives a new writing with the certificates.

This didn't happen in mirc version 6.35, from versions 7.x I noticed that. This is very harmful for HD, especially in my routine in a short space of time.

I hope you understood.
0 106 Read More
mIRC Help Jump to new posts
Re: Turkish character help Raccoon 27/11/21 07:29 PM
I would be willing to help write a Turkish compatibility script, given the huge popularity for such a solution. But I would need some help from someone who can experiment and articulate their issues to me.

My solution would be manual conversion of UTF-8 into the Turkish ANSI codepage via On PARSELINE manipulation.
2 131 Read More
Scripts & Popups Jump to new posts
Re: open query with date and month ( not good ) error TECO 26/11/21 04:01 PM
Sorry, I mistakenly made a mistake. In my code, I ask you to remove the $4-, and put it like this:
Code
$asctime(mmmm)
2 147 Read More
Bug Reports Jump to new posts
Re: Double icons for minimize/maximize/close KindOne 25/11/21 02:27 PM
What version of mIRC are you running? There was a duplicate icons bug that was fixed in 7.66.

Quote

29/06/2021 - mIRC v7.66
...
9.Fixed maximized MDI window duplicate icons bug.


Code
//echo -a $version


https://forums.mirc.com/ubbthreads.php/topics/268671/re-mdi-duplicate-icons
1 144 Read More
Feature Suggestions Jump to new posts
Re: Posting images in channel Loki12583 24/11/21 12:31 AM
Good for them
4 273 Read More
Bug Reports Jump to new posts
Re: nested while loops on one line bug? maroon 23/11/21 11:54 PM
Another test case to add to the list. It looks like the "suh" alias from 2004 works correctly now, however it seems that the nested while's on 1 line are preventing the /break command from working.

Code
//var %i 5 | while (%i) { var %t $ticks + 1000 | while (%t > $ticks) { noop } | echo -a $asctime i= %i | if (%i == 3) goto label | dec -s %i } | echo -a test1 | :label | echo -a test2



Code
//var %i 5 | while (%i) { var %t $ticks + 1000 | while (%t > $ticks) { noop } | echo -a $asctime i= %i | if (%i == 3) break | dec -s %i } | echo -a test1 | :label | echo -a test2



The 1st command correctly goto's to the label when %i reaches 3.

In old behavior, the 2nd of the above commands did a 'normal' loop exit at the bottom of the loop, immediately after decrementing %i to 4, instead of waiting until %i reached 3.

It should exit the loop immediately after displaying the message showing %i was now 3, but instead it now it repeats the outer while() repeatedly until %i reaches zero.

--

The above issue might be related to the issue of the {} required around the /noop for the inner while, as mentioned in https://forums.mirc.com/ubbthreads....e-loops-on-single-line-issues#Post264499


edit: seems /continue is being ignored same as /break is. The continue should prevent the /echo from being displayed at all:

//var %i 3 | while (%i) { dec -s %i | var %t $ticks + 1000 | while (%t > $ticks) { noop } | continue | echo -a this should not show }


13 13,389 Read More
mIRC Help Jump to new posts
Updated mirc and weird graphical issue in text box Chrysalis212 23/11/21 03:08 AM
Hi

Was using an older build of mirc for a while I forgot the build number but was at least 2 years old.

Due to letsencrypt certificate changes, I updated to the latest version to get the new bunder certificates, and up on restarting mirc I can now see there is almost no separator between the text box and the chat window,

I see in the changelog notes, in some recent builds there is some changes related to colours and borders, I think one of them may have regressed things.

I use a black background for both the text box and the chat box. If its relevant.
0 62 Read More
Scripts & Popups Jump to new posts
Re: sound mute off danielboom 20/11/21 09:03 PM
muito brigado
4 176 Read More
mIRC Help Jump to new posts
Re: Windows 11 Bug/Glitch. Wims 20/11/21 12:39 PM
Right click the top left icon of mirc, and uncheck the "on top" setting
1 120 Read More
mIRC Help Jump to new posts
Re: Question about a !view command maroon 20/11/21 01:43 AM
Not really sure what you're asking. At first I thought "site" meant website, now I'm thinking it means "IRC Network". At first I thought you meant a profile at a website, now I'm guessing you mean the info returned from the /whois command?

I can't tell if the !view is something that triggers a script on your own mirc, or whether it was a request from someone else to give it to you. If you're asking for help about a script, we need to know what that is. Is Excursion an irc network? a script?
1 135 Read More
Scripts & Popups Jump to new posts
Re: picture windows question maroon 20/11/21 01:40 AM
If your question is how to select a line in a -p pic window, you can't.
If your question is how to echo some text that's been added to a -p pic window, you can't. There isn't really text there, there's just a bunch of pixels arranged to look like text.
The closest you could come to faking it would be for you to have another @window where you shadow the -p pic window, where each time you write to the pic window you also write to the normal window, which creates a place for you to get the line info from.
1 118 Read More
Scripts & Popups Jump to new posts
Re: Cant match numbers after a partial nick catcher Orobas 17/11/21 08:37 PM
hiya Maroon

It would appear for the moment, that your edit is working

10:03] <Titan_Bot> 8,1CHECK NICK mom/mother/mum with numerics based nick. check it - amom34

I appreciate your time and candour on this thread and if i run into any issues i will report back on this thread, otherwise a huge thanks for your assistance
5 264 Read More
Scripts & Popups Jump to new posts
Re: help in blacklist maroon 17/11/21 02:39 AM
You were not clear what you mean by "didn't work". There can be many reasons that something does not perform the goal you wish, but it's still working at doing something, even if it's the wrong thing.

You should include some debugging messages so you can see in the status window if something is reaching certain locations. At minimum these messages should include $scriptline $nopath($script) so you can find them later and kill them based on the message being displayed.

One thing the debugging message tells you is whether the event-handler is even being triggered, which could be caused by having remote events disabled, which you can check by: /remote

Another thing it tells is whether something is branching the correct direction after a while() or if() condition. If you put one of these debugging echoes above and below the while(), then that can be a problem depending on whether it should/shoutdn't be seeing the 2nd echo. Once you see where the branching mistake is happening, then you can edit your echo to include extra info to see why the mistake is happening.

echo -s $scriptline $nopath($script) : $ $+ istok( %blacklist , $nick , $32 ) )
if ($istok(%blacklist,$nick,32)) { do this }
echo -s $scriptline $nopath($script)

When you echo variables you must make sure they don't touch parenthesis, commas, etc - because the rules in an echo are different than when they're parameters inside an identifier.

I also edited one of your events to make it a little more efficient. You don't care about the $numtok, you only care about each token in the list, so this avoids calculating $numtok. You can do this since the token will not be $null until you run out of tokens. Also, you don't care about how MANY wildtok matches there are, you just care if there are ANY matches, so you simply check if there is a 1st match, not counting how many matches are are. The $v1 is destroyed as soon as it encounters another if() or while(), so if you need it later on you can do something like "/var %v1 $v1"

One thing I didn't change is how you're handling $comchan. The way you are handling this, it only kicks them out of the last common channel in your switchbar/treebar, which isn't necessarily the same as the last channel they joined, or the channel you really want to kick them out of, If you want to kick them out of each channel, then you'd need to have a while() loop to do that. Your using of %ii only needs a local variable that vanishes when leaving the alias/event, so there's no need to create a permanent global variable

You may want to look at /help Event Prefixes
The @ event prefix can avoid this script triggering the ON JOIN if someone joins a #channel where you don't have the Ops powers to do any of this

Code
on *:nick:{
  tokenize 32 %blacklist
  var %x 1
  while ($gettok(%blacklist,%x,32) != $null) {
    if ($wildtok($fulladdress, $v1 ,1,32) != $null) {
      var %ii $comchan($newnick,0)
      if (%blp == 0) { kick $comchan($newnick,%ii) $newnick %blkreason }
      else { ban -u300 $comchan($newnick,%ii) $newnick 1 | kick $comchan($newnick,%ii) $newnick %blkreason }
    }
    inc %x
  }
}


Some of what you're doing can be handled in "user lists" It would've been easier to understand user lists if a list of the identifiers and commands that the users tab of scripts editor interacts with were found in 1 page, instead of being split across the help pages at

/help Remote Commands
/help Remote Identifiers
/help Remote Levels
1 103 Read More
Scripts & Popups Jump to new posts
$bytes() replacement Talon 15/11/21 07:50 PM
Here is a drop-in replacement that should fix issues with $bytes() (up to mIRC's precision limit of $calc())
$byte(N,bkmgtp3d)
Returns comma formatted file-size.
Properties: suf

The bkmgtp options return the result as bytes, kilobytes, etc.
The .suf property appends the suffixes to the result.
The d option retains decimal point values.
The 3 option returns a result in 3 digit format.
if the int is length of 1, returns two decimals (x.xx)
if the int is length of 2, returns one decimal (xx.x)
if the int is length of 3 and contains a decimal, it's rounded so long as the round doesn't go above length of 3 (998.9 == 999), if it would, then the next option is used. If all 5 options are used up and the 6th (petabytes) still exceeds 3, it just returns like option p.

NOTES: option 3 ignores all other passed options (just like mIRC)
passing multiple options, it uses the LAST found VALID option (ignoring garbage characters, just like mIRC) in the list.
mIRC however, uses the highest found VALID option.

Highest vs Last found example:
//echo -a $bytes(1024,bktacom).suf
0TB

//echo -a $byte(1024,bktacom).suf
0MB

Comparison using "d" flag example:
//echo -a $bytes(5843560,d).suf
5.572853MB

//echo -a $byte(5843560,d).suf
5.572853MB

Below are other comparison examples covering everything else, following maroon's sections showing mIRC vs scripted.

1a.
//echo -a $bytes( $calc(2^53-1) ).suf
8,192TB

//echo -a $byte( $calc(2^53-1) ).suf
8PB

1b.
//var %a 1234567890123456 , %b 0 | while (%b <= 13) { echo -a bytes: $bytes(%a $+ $str(0,%b),3).suf | inc %b }
bytes: 1,122TB
bytes: 1,122TB
bytes: 1,122TB
bytes: 1,122TB
bytes: 1,122TB
bytes: 1,122TB
bytes: 1,122TB
bytes: 1,122TB
bytes: 1,122TB
bytes: 1,122TB
bytes: 1,122TB
bytes: 1,122TB
bytes: 1,122TB
bytes: 11,228,329,550,462,658TB


//var %a 1234567890123456 , %b 0 | while (%b <= 13) { echo -a bytes: $byte(%a $+ $str(0,%b),3).suf | inc %b }
bytes: 1.10PB
bytes: 10.9PB
bytes: 110PB
bytes: 1,096.52PB
bytes: 10,965.17PB
bytes: 109,651.66PB
bytes: 1,096,516.56PB
bytes: 10,965,165.58PB
bytes: 109,651,655.77PB
bytes: 1,096,516,557.66PB
bytes: 10,965,165,576.62PB
bytes: 109,651,655,766.24PB
bytes: 1,096,516,557,662.37PB
bytes: 10,965,165,576,623.68PB

2a.
//echo -a $bytes( $calc(999*1024+1018) ,3).suf vs $bytes( $calc(999*1024+1019) ,3).suf vs $bytes( $calc(999*1024+1024) ,3).suf
999KB vs 1,000KB vs 0.98MB

//echo -a $byte( $calc(999*1024+1018) ,3).suf vs $byte( $calc(999*1024+1019) ,3).suf vs $byte( $calc(999*1024+1024) ,3).suf
0.98MB vs 0.98MB vs 0.98MB

2b.
//echo -a $bytes($calc(500*1024+1018),3).suf vs $bytes($calc(500*1024+1018)).suf
500KB vs 500.99KB

//echo -a $byte($calc(500*1024+1018),3).suf vs $byte($calc(500*1024+1018)).suf
501KB vs 500.99KB

Code
byte {
  var %a = $1 , %b = $2 , %chart = B KB MB GB TB PB , %logn = $log(%a) / $log(1024) , %range = $pos(bkmgtp,$mid($regsubex(%b,/[^bkmgtp]/g,),-1),1)
  if (3 !isin %b) { 
    var %math = $calc($1 / 1024 ^ $iif(!%range,$iif($int(%logn) > 6,6,$v1),$calc(%range -1))) 
    if (d !isin %b) { var %math = $round(%math,2) }
  }
  else {
    var %range = 1
    while (%range <= 6) {
      var %math = $round($calc(%a / 1024 ^ (%range -1)),2)
      tokenize 46 %math
      if ($calc($len($1) + $len($2)) <= 3) { break }
      elseif ($calc($len($1) + 1) <= 3) { var %math = $mid(%math,1,4) | break }
      elseif ($len($round(%math,0)) <= 3) { var %math = $round(%math,0) | break }
      elseif (%range = 6) { break }
      else { inc %range }
    }
  }
  tokenize 46 %math
  var %int = $regsubex($1,/(\d)(?=(\d{3})+$)/g,\1 $+ $chr(44)) , %dec = $2
  if (3 isin %b) && ($len(%dec) <= 1 && $len($1) <= 2) { var %dec = $calc($2 + 0) $+ $str(0,$calc(2 - $v1))) }
  return $+(%int,$iif(%dec != $null,.),%dec,$iif($prop = suf,$gettok(%chart,$iif(!%range,$iif($calc($int(%logn) + 1) > 6,6,$v1),%range),32)))
}


May need some further testing, little unsure about xx.x portion, because I used $mid() here to get around the complication of $round(N,1) not returning one decimal if the result is within a certain size. My small-scale tests seem to show correctly compared to mIRC's returns, but I didn't test this heavily.

Examples of $round():
$round(0.9876543,2) == 0.99
$round(0.9876543,1) == 1 (not 0.9)

Example of similar result:
//echo -a $bytes($calc(1024*98 + 1002),3).suf
98.9KB

//echo -a $byte($calc(1024*98 + 1002),3).suf
98.9KB

If you swapped $mid(%math,1,4) with $round(%math,1) the result would've been:
99.0KB
0 99 Read More
Bug Reports Jump to new posts
Re: Edge cases with $bytes Khaled 15/11/21 01:01 PM
1a. Possibly :-)

1b. If you are using numbers that could result in calculations exceeding the number range, anything can and will happen.

2a. This is all about rounding/rounding errors.

2b. Again, this is about rounding/rounding errors.

This could also be due to whether kilobytes are 1000 or 1024 bytes, depending on context. It's quite likely that in code developed over 25+ years, both 1000 and 1024 are being used in different places, based on what users requested/what I thought made sense at the time.

It could also be due to the number of significant figures being used, eg. 1.990001 to two significant figures would round to 2.0.

And so on, and so on.

It would have been helpful if you had included:

/alias or $identifier is displaying: X
I believe it should be displaying: Y

But, really, the purpose of $bytes() was to return a reasonably useful result for displaying an approximate value in different formats, which it does. I will make some changes to the rounding significant figures in the next beta though.
1 266 Read More
Scripts & Popups Jump to new posts
Re: :error label not triggering Khaled 15/11/21 11:25 AM
The goto and error label handling work in completely different ways.

The error handler is not jumping back in this case because the error label is before the command causing the error, so jumping back would likely result in an infinite loop.

That said, the error handler was implemented so long ago that the only way to be sure is to test it out. Either way, its behaviour will not be changed as this would cause backward compatibility issues.
1 141 Read More
Scripts & Popups Jump to new posts
Re: anti insults - helpme please maroon 15/11/21 07:52 AM
What you're asking for is similar to this thread: https://forums.mirc.com/ubbthreads.php/topics/264491/re-bad-word-in-txt-file#Post264491

The problem with your method is that you require a separate if () evaluation for every bad word in the list. Another problem with 'isin' is that it can easily match things it should not, like:

//if (word isin sword) echo -a match

The link shows how using $hfind can accomplish your task much quicker, because there can be 1 function call which matches all badwords against the entire $1- in 1 identifier call. It uses Regex, and while it looks more complicated, you can have much better ability to prevent false matches by having your bad word be required to be a complete word instead of only being a portion of it.

//hadd -m badwords word1 *perra* | hadd badwords word2 *cybersex* | hadd badwords word3 *striper* | echo -a $hfind(badwords,foo perra bar,1,W).data

This is a quick example where $hfind can compare all words in your list at the same time against $1-

For this to work, you can create a hashtable where the itemname is a unique word, it doesn't matter what it is, and the data is where you put the badword as a wildcard string. The capital W switch means that the wildcard string is in the hashtable, and using the .data makes it try to match the data instead of the itemname.

The hashtable lives in memory, so it disappears when you quit mirc, unless you save it to disk like

/hsave -s badwords badwords.txt

... and the next time you start mirc, you can either use the commands above to re-make the bad word list, or you can load the list off disk like:

/hload -s badwords badwords.txt

I could have made the badword be the itemname instead of the data, but that would not allow you to have the badword be a string of several words.

In my example, $hfind returned the item name where the data contained the bad word. If word1 is returned by $hfind, you can use $hget(badword,word1) to see what the match found.
1 118 Read More
Page 1 of 2 1 2