mIRC Home    About    Download    Register    News    Help

Print Thread
#273652 11/10/25 04:02 PM
Joined: Nov 2021
Posts: 166
Simo Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Nov 2021
Posts: 166
Greetings,

Anyway we can have this choose equally between the choices its been given because now it selects random result in sometimes for example choosing 1 opion 10 times and the other 1 time we want to choose different each time.

perhaps it could be achieved with a while loop or something,


Code

alias rcloakx3 {
  set -u1 %xcloakz $gettok(3x 7a,$rand(1,2),32)
if (%xcloakz == 3x) { vh $1  $cloakjhtyafvdl $+ - $+  $cloakjhtyafvdl $+ - $+ $cloakjhtyafvdl $+ - $+  $cloakjhtyafvdl $+ - $+ $cloakjhtyafvdl $+ . $+ $cloakjhtyafvdXX $+ . $+ $cloakjhtyafvdXX $+ .ip }
  if (%xcloakz == 7a) { var %randomircloud $regsubex($str(x,6),/./g,$iif($r(0,1)  == 1,$r(0,9),$r(0,9)))) | vh $1 sid $+ - $+ %randomircloud $+ . $+ $rcloud | iden $1 sid $+  $+ %randomircloud }
}



thanks in advance

Simo #273653 14/10/25 02:06 AM
Joined: Jul 2006
Posts: 4,031
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,031
Code
alias rcloakx3 {
  ;cycle between 3x and 7a
  if (%3x7a == 3x) { set -u1 %xcloackz 7a | unset %3x7a }
  elseif (%3x7a == 7a) set -u1 %xcloackz 3x | unset %3x7a }
  else { set -u1 %xcloackz $gettok(3x 7a,$rand(1,2),32) | set %3x7a %xcloackz }

  ;optimized with $str and $left
  if (%xcloakz == 3x) { vh $1  $left($str($cloakjhtyafvdl $+ -,5),-1) $+ $str(. $+ $cloakjhtyafvdXX,2) $+ .ip }
  elseif (%xcloakz == 7a) {
    ;cycle random 0-9
    if (%randomcycle09 == $null) set %randomcycle09 0 1 2 3 4 5 6 7 8 9
    var %x 6,%randomircloud,%t
    while (%x) {
      %t = $gettok(%randomcycle09,$r(1,$numtok(%randomcycle09,32)),32)
      %randomircloud = %randomircloud $+ %t
      %randomcycle09 = $remtok(%randomcycle09,%t,32)
      if (%randomcycle09 == $null) set %randomcycle09 0 1 2 3 4 5 6 7 8 9
      dec %x
    }
    ;weird $+ $+ there but i didn't touch in case there's an invisible char or because it's unfinished.
    vh $1 sid $+ - $+ %randomircloud $+ . $+ $rcloud | iden $1 sid $+  $+ %randomircloud
  }
}
Untested but should wait until all digits were chosen randomly once between it reset back to all of them, and so accross all functions, not just for the 6 iterations, meaning that when you start, if the 6 iterations gives 0 1 2 3 4 5, you can't get any of these digits for the next 6 iterations, which would get randomly 6 7 8 9 before reseting back to any 0-9 randomly for the remaining 2 iterations.

Last edited by Wims; 14/10/25 10:08 AM.

#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Wims #273655 14/10/25 03:57 PM
Joined: Nov 2021
Posts: 166
Simo Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Nov 2021
Posts: 166
thanks wims, ive tried it out but it didnt seem to trigger at all

Simo #273656 14/10/25 09:16 PM
Joined: Jul 2006
Posts: 4,031
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,031
In the first three line I used the variable name '%xcloackz' with an extra 'c' instead of '%xcloakz'


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Wims #273657 15/10/25 02:11 PM
Joined: Nov 2021
Posts: 166
Simo Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Nov 2021
Posts: 166
thanks Wims,

also this line had an { missing

elseif (%3x7a == 7a) set -u1 %xcloackz 3x | unset %3x7a }

instead of

elseif (%3x7a == 7a) { set -u1 %xcloakz 3x | unset %3x7a }



after all corrections it seems to work as expected now , thanks al lot Wims much apreciated.

Wims #273658 15/10/25 03:10 PM
Joined: Nov 2021
Posts: 166
Simo Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Nov 2021
Posts: 166
also this produces duplicate outputs :

if (%xcloakz == 3x) { vh $1 $left($str($cloakjhtyafvdl $+ -,5),-1) $+ $str(. $+ $cloakjhtyafvdXX,2) $+ .ip }

example :

26ue-26ue-26ue-26ue-26ue.378.378.ip
58gh-58gh-58gh-58gh-58gh.166.166.ip
mbda-mbda-mbda-mbda-mbda.827.827.ip

Simo #273659 15/10/25 06:23 PM
Joined: Jul 2006
Posts: 4,031
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,031
I hadn't slept for 2 days, what a shame. Glad it works with the fixes.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Wims #273660 16/10/25 01:31 AM
Joined: Nov 2021
Posts: 166
Simo Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Nov 2021
Posts: 166
Except this doesn't work as expected as i mentioned in previous post, it outputs duplicate strings :

if (%xcloakz == 3x) { vh $1 $left($str($cloakjhtyafvdl $+ -,5),-1) $+ $str(. $+ $cloakjhtyafvdXX,2) $+ .ip }

Simo #273661 16/10/25 09:39 AM
Joined: Jul 2006
Posts: 4,031
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,031
Yes, the optimization I did is incorrect, just revert back to the original code for that if:

if (%xcloakz == 3x) { vh $1 $cloakjhtyafvdl $+ - $+ $cloakjhtyafvdl $+ - $+ $cloakjhtyafvdl $+ - $+ $cloakjhtyafvdl $+ - $+ $cloakjhtyafvdl $+ . $+ $cloakjhtyafvdXX $+ . $+ $cloakjhtyafvdXX $+ .ip }


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Wims #273662 16/10/25 11:27 AM
Joined: Nov 2021
Posts: 166
Simo Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Nov 2021
Posts: 166
Thanks wims, i used original as well but was hoping your shorter version could be made to work but from what i understand from you is it can't be made to work, if i understood well.


BTW these are the aliases for it :

Code
 

alias cloakjhtyafvdl { return $regsubex($str(x,$r(4,5)),/./g,$iif($r(0,1) == 1,$r(a,z),$iif($r(0,1) == 1,$r(a,z),$r(0,9)))) }

alias cloakjhtyafvdXX { return $regsubex($str(x,$r(2,3)),/./g,$iif($r(0,1) == 1,$r(0,9),$iif($r(0,1) == 1,$r(0,9),$r(0,9)))) }


Much appreciated,

Simo.

Last edited by Simo; 16/10/25 03:01 PM.

Link Copied to Clipboard