mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Oct 2005
Posts: 35
C
Crap Offline OP
Ameglian cow
OP Offline
Ameglian cow
C
Joined: Oct 2005
Posts: 35
Hi!
I'll try to explain as good as I can:

I would like to have a notice output, that look like this:
Code:
-RPGServ:#testscript- <Roll for Gasten [20[1d4]]: 4 2 4 4 1 3 1 4 3 3 1 4 1 3 1 4 3 3 1 3 >

to be sorted in value sizes (I don't know what it is in english, but it is similar to what happens with $sorttok).

The code I've managed to come up with looks like this:
Code:
on *:NOTICE:*:*: {
  var %resultlistrem = $$5-
  var %resultlistrem = $deltok(%resultlistrem,-1,22)
  ; Deletes that last >
  var %resultlistrem = $sorttok(%resultlistrem,22,n) 
  echo -a %resultlistrem
}
; 22 == [[space]]

...And when I run it doesn't return any echo.
(I've understood that there isn't anything in the variable %resultlistrem, more of that in the following part:)

After hours of debugging i tried to see where the variable destroys (using this code:
Code:
on *:NOTICE:*:*: {
  var %resultlistrem = $$5-
  echo -a %resultlistrem
  var %resultlistrem = $deltok(%resultlistrem,-1,22)
  if %resultlistrem {
    echo -a Yes
  }
  elseif !%resultlistrem {
    echo -a No
  }
  var %resultlistrem = $sorttok(%resultlistrem,22,n) 
  echo -a %resultlistrem
}

). The output where this:
Code:
-RPGServ:#testscript- <Roll for Gasten [20[1d4]]: 4 1 1 1 1 1 3 4 3 4 2 1 4 1 4 3 3 3 2 4 > 
4 1 1 1 1 1 3 4 3 4 2 1 4 1 4 3 3 3 2 4 >
No
1 1 1 1 3 4 3 4 2 1 4 1 4 3 3 3 2 4 >
No

Now, why does it repeat itself? And why is the two first numbers in the second echo gone? And more important: what should I do to get mIRC returning a sorted version of that list?

Thankfully,
Crap aka Gasten


#indierpgs @ magicstar.net Your indie-rpg fix. Online.
Joined: May 2006
Posts: 93
Babel fish
Offline
Babel fish
Joined: May 2006
Posts: 93
isn't the space ascii 32?
//echo -a $sorttok(4 2 4 4 1 3 1 4 3 3 1 4 1 3 1 4 3 3 1 3,22,n)
returns 4 2 4 4 1 3 1 4 3 3 1 4 1 3 1 4 3 3 1 3
//echo -a $sorttok(4 2 4 4 1 3 1 4 3 3 1 4 1 3 1 4 3 3 1 3,32,n)
returns 1 1 1 1 1 1 2 3 3 3 3 3 3 3 4 4 4 4 4 4

Joined: Apr 2006
Posts: 400
K
Fjord artisan
Offline
Fjord artisan
K
Joined: Apr 2006
Posts: 400
yes, it is, use this script, I use it very often, but, can't use space on it though :\
Code:
asc {
  echo -a The ASCII number of $1 is $asc($1) 
}


-Kurdish_Assass1n
Joined: Oct 2005
Posts: 35
C
Crap Offline OP
Ameglian cow
OP Offline
Ameglian cow
C
Joined: Oct 2005
Posts: 35
O, yea.. right. Now I'm feeling stupid.

Well, I still got one problem:

No, wait. I solved it myself smile the :*: for channel in ON should be :#:, because it sended the notice to my computer too smile

Thank you!


#indierpgs @ magicstar.net Your indie-rpg fix. Online.
Joined: Oct 2005
Posts: 35
C
Crap Offline OP
Ameglian cow
OP Offline
Ameglian cow
C
Joined: Oct 2005
Posts: 35
But shouldn't you use $char() to see what the asc is? It have worked before... Then 22 would be space.


#indierpgs @ magicstar.net Your indie-rpg fix. Online.
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
32 is space

this will work to say 97 a
//say $asc(a) $chr(97)

try this to show the space character
//say $chr(63) $+ $chr(32) $+ $chr(63)

$chr(22) is the code mIRC uses for "Reverse" (ctrl+r) .


Link Copied to Clipboard