mirc

Script to generate random string not working

核能气质少年 提交于 2019-12-25 03:59:11
问题 I'm trying to generate random string with white spaces but it is not working : /rs { %i=1 %r=$rand(1,50) %s=$rand(a,z) while(%i <= %r) { %i=%i+1 %s=%s $+ $rand(a,z) if(1 == rand(1,4) %s=%s $+ $chr(32) } echo %s } Returns : WHILE(%I Unknown command Any ideas ? 回答1: You had some issues, those are just few of them. Spaces: mSL statements are sensebile when it concerns to spaces, those you should put spaces between the while (expression) , if (expression) and even %i = 1 and %r = $rand(1,50) etc'

mIRC Search for multiple words in text file

六眼飞鱼酱① 提交于 2019-12-12 03:47:34
问题 I am trying to search a text file that will return a result if more than one word is found in that line. I don't see this explained in the documentation and I have tried various loops with no success. What I would like to do is something similar to this: $read(name.txt, s, word1|word2|word3) or even something like this: $read(name.txt, w, word1*|*word2*|*word3) I don't know RegEx that well so I'm assuming this can be done with that but I don't know how to do that. 回答1: The documentation in

mIRC bot - copy/paste lines in 2 channels

柔情痞子 提交于 2019-12-11 04:52:21
问题 I’m a noob in mirc scripting, and I need some help. there’s 2 irc channels. let’s call then #channel1 and #channel2; There’s 2 bots. One is mine, let’s call him “mybot” (my bot is in both channels). The other bot is from a third person, let’s call him “otherBot”; What I need is… let me make an example to better explain. a) in #channel1 some user type: [14:38:48] <@someuser> !user xpto At this time, “mybot” is in both channels. he reads the command “!user*” and copy/paste it in #channel2,

Get highest value from a file using mSL and mIRC

你说的曾经没有我的故事 提交于 2019-12-11 02:58:56
问题 Currently I have an irc bot that when a user says a keyword e.g test1 they get +1 added to their count, which is stored in a file. However I wanted to know who had the biggest count (who was winning). I thought something like a while loop would work, looking for the numbers against the nickname, unfortunately, although my pseudo code is correct, the theoretical code, not so much. This is what I have so far. on *:TEXT:!winning:#:{ var %i = 1, %highest = 0, %mycookie = $readini(cookies.ini,n,#,

Parsing mIRC colors in php

喜欢而已 提交于 2019-12-09 21:06:39
问题 I want to convert mirc color codes to html via php. Here is the example: http://searchirc.com/search.php?F=exact&T=chan&N=6246&I=anime-pirates Thanks 回答1: Use preg_replace_callback: function mycallback($matches) { $bindings = array( 0=>'white', 1=>'black', 2=>'blue', 3=>'green', 4=>'red', 5=>'brown', 6=>'purple', ); $fg = isset($bindings[$matches[1]]) ? $bindings[$matches[1]] : 'transparent'; $bg = isset($bindings[$matches[2]]) ? $bindings[$matches[2]] : 'transparent'; return '<span style=

Mirc control codes to html, through php

霸气de小男生 提交于 2019-12-08 07:42:44
问题 I realize this has been asked before, on this very forum no less, but the proposed solution was not reliable for me. I have been working on this for a week or more by now, and I stayed up 'till 3am yesterday working on it... But I digress, let me get to the issue at hand: For those unaware, mirc uses ascii control codes to control character color, underline, weight, and italics. The ascii code for the color is 3, bold 2, underline 1F, italic 1D, and reverse(white text on black background), 16

Parsing mIRC colors in php

为君一笑 提交于 2019-12-04 17:39:59
I want to convert mirc color codes to html via php. Here is the example: http://searchirc.com/search.php?F=exact&T=chan&N=6246&I=anime-pirates Thanks Use preg_replace_callback : function mycallback($matches) { $bindings = array( 0=>'white', 1=>'black', 2=>'blue', 3=>'green', 4=>'red', 5=>'brown', 6=>'purple', ); $fg = isset($bindings[$matches[1]]) ? $bindings[$matches[1]] : 'transparent'; $bg = isset($bindings[$matches[2]]) ? $bindings[$matches[2]] : 'transparent'; return '<span style="color: '.$fg.'; background: '.$bg.';">'.$matches[3].'</span>'; } $str = '^C3,1Hello^C foo ^C6,2World^C'; $str