mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 3 1 2 3
#30809 19/06/03 09:52 AM
Joined: Apr 2003
Posts: 26
P
Ameglian cow
OP Offline
Ameglian cow
P
Joined: Apr 2003
Posts: 26
https://forums.mirc.com/showflat.php?Cat=...=true#Post30982

(So no one can tell me I didn't search :P)

But isn't there any way so you can handle multiple spaces in events?? (on INPUT, on TEXT)
I've tried a lot of things (replacing $chr(32) with $chr(160)) but nothing works in events. Maybe some one that knows a good script around??

#30810 19/06/03 10:07 AM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
i know one of the threads mentioned chr(160), becasue i got the idea from here afterall. Maybe you didn't search well enough. >:D


-KingTomato
#30811 19/06/03 10:13 AM
Joined: Apr 2003
Posts: 26
P
Ameglian cow
OP Offline
Ameglian cow
P
Joined: Apr 2003
Posts: 26
Maybe you could give me a hand?.. have searched, couldn't find it :tongue:

#30812 19/06/03 10:14 AM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
5 spaces = $str($chr(160), 5) etc

EDIT:
keep in mind that does not work for incoming text, only outgoing. I.e. you can't preserv an on text's sequencial spacing using that.


-KingTomato
#30813 19/06/03 10:17 AM
Joined: Apr 2003
Posts: 26
P
Ameglian cow
OP Offline
Ameglian cow
P
Joined: Apr 2003
Posts: 26
I know that, but that's not what i want, I know how to send multiple spaces, but what i want is:

on ^*:TEXT:*:#:{
echo $chan $timestamp < $+ $nick $+ > $replace($1-,$chr(32),$chr(160))
}

For instance, if someone SENDS me a line containing multiple spaces, i want to echo the multiple spaces, but so far, everything i tried, failed.. :@

Any ideas?

#30814 19/06/03 10:22 AM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
incase u didn't see it considering i posted it presumibly while you were replying

Quote:

EDIT:
keep in mind that does not work for incoming text, only outgoing. I.e. you can't preserv an on text's sequencial spacing using that.


not pssible, thats like saying..

Code:
/test {
  var %a = 1, %string = .a.b.c......d.e.f
  while ($gettok(%string, %a, 46)) {
    /set %t [ $+ [ %a ] ] $ifmatch
    /inc %a
  }
  /echo -a %t4
}


we all know %t4 will echo d. Same goes with spaces. Mirc handles the $1, $2, ..., $n by seperating things by spaces. So if it sees two spaces and a null between them, why should it be counted? I mean if you had (underscores represent spaces)

hello_there____kingtomato

and had

on 1:TEXT:*:#: {
/echo -a $3
}

would you really want $3 to echo a null just so you can have multiple spaces?


-KingTomato
#30815 19/06/03 10:24 AM
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
if ($chr(32) $+ * iswm $1-) {
//echo -a $chr(32) $+ $1-
}
if (* $+ $chr(32) iswm $1-) {
//echo -a $1- $+ $chr(32)
}
if (* $+ $chr(32) $+ * iswm $1-) {
/tokenize 32 $1-
//echo -a $1 $2 $3 $4 $5
}
think that should work :tongue:

or you could try

var %space $replace($1-,$chr(32),_)

//echo -a $replace(%space,_,$chr(32))

Last edited by pheonix; 19/06/03 10:26 AM.

new username: tidy_trax
#30816 19/06/03 10:29 AM
Joined: Apr 2003
Posts: 26
P
Ameglian cow
OP Offline
Ameglian cow
P
Joined: Apr 2003
Posts: 26
Quote:
would you really want $3 to echo a null just so you can have multiple spaces?


No, that wouldn't be a good solution either, it would be real messy, but i would like to see that mIRC gives an option to access the raw text that was send with the multiple spaces for example, but i think a have found a solution using RAWs. If it works i'll post it smile

#30817 19/06/03 10:31 AM
Joined: Apr 2003
Posts: 26
P
Ameglian cow
OP Offline
Ameglian cow
P
Joined: Apr 2003
Posts: 26
Quote:
var %space $replace($1-,$chr(32),_)

//echo -a $replace(%space,_,$chr(32))


I've tried that in a lot of different ways and it doesn't work. The problem is, that mIRC itself does a little cleanup on the message send, before it triggers a on TEXT event.

#30818 19/06/03 10:31 AM
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
you can write a dll to make it work, but im sure theres an easier way :tongue:


new username: tidy_trax
#30819 19/06/03 10:32 AM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Don't even try, raws don't respond to commands already responded and enterpreted by mirc. I do agree with you in a raw tho. Such as ever event could have a &raw variable.

on 1:TEXT:*:#: {
/echo -a This is the text sent $1-
/echo -a Raw text: $bvar(&raw, 1, $bvar(&raw, 1, 0)).text
}

the binary is able to hold consecutive spaces making it ultimatly the most reasonable choice.


-KingTomato
#30820 19/06/03 10:34 AM
Joined: Apr 2003
Posts: 26
P
Ameglian cow
OP Offline
Ameglian cow
P
Joined: Apr 2003
Posts: 26
First thing also doesn't do what i want frown

#30821 19/06/03 10:35 AM
Joined: Apr 2003
Posts: 26
P
Ameglian cow
OP Offline
Ameglian cow
P
Joined: Apr 2003
Posts: 26
Quote:
on 1:TEXT:*:#: {
/echo -a This is the text sent $1-
/echo -a Raw text: $bvar(&raw, 1, $bvar(&raw, 1, 0)).text
}

the binary is able to hold consecutive spaces making it ultimatly the most reasonable choice.

Yes that would be a good option, maybe post it in the future suggestions topic :P

Last edited by Poltergeist; 19/06/03 10:36 AM.
#30822 19/06/03 10:36 AM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
I can almost definalty say it has been at one point in time. Besides the one person that matters is Khaled, and he frequents all boards. No need to post twice.


-KingTomato
#30823 19/06/03 10:38 AM
Joined: Apr 2003
Posts: 26
P
Ameglian cow
OP Offline
Ameglian cow
P
Joined: Apr 2003
Posts: 26
Alright smile

#30824 19/06/03 10:52 AM
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
Quote:
would you really want $3 to echo a null just so you can have multiple spaces?


Hell yeah, I'd love to see that. It would be completely easy to strip for those who didnt want that functionality (var %a | !.echo -q $regsub($1-,/( +)/g,$chr(32),%a) | tokenize 32 %a), or a function could be built in for people who don't want to figure it out themselves. It's a simple solution (from the scripter's perspective) for what is, in my opinion, the biggest problem in mIRC scripting.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
#30825 19/06/03 10:56 AM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
I still say a raw would be a better alternative than a $null. Or maybe an added system like $1, $2, ..., $N for the "regular" tokens, then $r1, $r2, ..., $rN for the "raw" and "true" token identifyers.

BTW, <--- 1000 >:D


-KingTomato
#30826 19/06/03 11:13 AM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
Or just /tokenize 32 $1- since /tokenize already kills consecutive tokens smile For the sake of backwards compatibility though, I'd like to see a new identifier (like $rawtext or $fulltext or whatever) while having $N work the same way.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
#30827 19/06/03 11:20 AM
Joined: Apr 2003
Posts: 26
P
Ameglian cow
OP Offline
Ameglian cow
P
Joined: Apr 2003
Posts: 26
Quote:
I'd like to see a new identifier (like $rawtext or $fulltext or whatever) while having $N work the same way


I'm with that laugh

#30828 19/06/03 11:50 AM
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
True, but if mIRC scripting supported null tokens would /tokenize still behave like that? I do agree that a new identifier or identifier set would be better for compatability since this could otherwise kill a lot of old scripts.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Page 1 of 3 1 2 3

Link Copied to Clipboard