|
Joined: Jun 2007
Posts: 10
Pikka bird
|
OP
Pikka bird
Joined: Jun 2007
Posts: 10 |
i´ve got some problem with the listbox and the raw 006 (/map response). I found no way to add the received line into the listbox with the Spaces before the text. Pics: This is how it should be adapted by the listbox: This is how it is at the dialoque:  How can i make mIRC add these spaces to the string?
[url=irc://irc.dream-irc.de][url=irc://irc.dream-irc.de][url=irc://irc.dream-irc.de][url=irc://irc.dream-irc.de]irc://irc.dream-irc.de[/url][/url][/url][/url]<- small,cute Network http://irc-security.no-ip.org IRC-Security
|
|
|
|
Joined: Jun 2007
Posts: 933
Hoopy frood
|
Hoopy frood
Joined: Jun 2007
Posts: 933 |
I have tested it a bit and I don't think it can be written to a .txt file cleanly. Something that does kind of work is:
raw 006:*:{
if ($left($2,1) == $chr(96)) { write map.txt $str(.,%indent) $+ $2- | inc %indent }
else { write map.txt $str(.,%indent) $+ $2- }
}
raw 007:*:{ unset %indent }
This adds periods (.) to the beginning of the string according to how man sublink tokens (`) it's encountered. Edit: you can try replacing the . in $str() with $chr(32) but it will probably not work.
Last edited by 5618; 22/06/07 06:30 PM.
|
|
|
|
Joined: Jun 2007
Posts: 10
Pikka bird
|
OP
Pikka bird
Joined: Jun 2007
Posts: 10 |
The problem is, i want to add it to an dialog listbox, not to a txt, because if i read out the txt mirc removes the spaces again. And at the raw event i can´t use $replace for replacing the spaces with other signs.
[url=irc://irc.dream-irc.de][url=irc://irc.dream-irc.de][url=irc://irc.dream-irc.de][url=irc://irc.dream-irc.de]irc://irc.dream-irc.de[/url][/url][/url][/url]<- small,cute Network http://irc-security.no-ip.org IRC-Security
|
|
|
|
Joined: Jun 2007
Posts: 933
Hoopy frood
|
Hoopy frood
Joined: Jun 2007
Posts: 933 |
Well, the script bit kind of manages to replace space. Instead of writing to a .txt you could make it go to the dialog, or make the dialog read the .txt output.
|
|
|
|
Joined: Jun 2007
Posts: 10
Pikka bird
|
OP
Pikka bird
Joined: Jun 2007
Posts: 10 |
ah thx, that helps me very much
[url=irc://irc.dream-irc.de][url=irc://irc.dream-irc.de][url=irc://irc.dream-irc.de][url=irc://irc.dream-irc.de]irc://irc.dream-irc.de[/url][/url][/url][/url]<- small,cute Network http://irc-security.no-ip.org IRC-Security
|
|
|
|
Joined: Sep 2005
Posts: 2,881
Hoopy frood
|
Hoopy frood
Joined: Sep 2005
Posts: 2,881 |
alias makebinarystring { return $regsubex($1,/(.)/g,$asc(\t) $+ $chr(32)) }
dialog map {
title "Network map"
size -1 -1 300 300
list 1, 0 0 300 300, size vsbar
}
raw 015:*:{
bset &data 1 $makebinarystring($2-) 13 10
bwrite $qt($scriptdir $+ map.dat) -1 -1 &data
haltdef
}
raw 017:*:{
if (!$dialog(map)) { dialog -m map map }
did -r map 1
loadbuf -o map 1 $qt($scriptdir $+ map.dat)
.remove $qt($scriptdir $+ map.dat)
haltdef
} If those raw numerics are different on your network, just changing the numbers should work, unless the format differs as well. I tested that script on ircnet and it seems to work. 015 = server list of /map command 017 = end of /map
|
|
|
|
Joined: Jun 2007
Posts: 10
Pikka bird
|
OP
Pikka bird
Joined: Jun 2007
Posts: 10 |
It doesn´t work, the same problem, the last two servers are linked to the services.
[url=irc://irc.dream-irc.de][url=irc://irc.dream-irc.de][url=irc://irc.dream-irc.de][url=irc://irc.dream-irc.de]irc://irc.dream-irc.de[/url][/url][/url][/url]<- small,cute Network http://irc-security.no-ip.org IRC-Security
|
|
|
|
Joined: Jan 2003
Posts: 2,523
Hoopy frood
|
Hoopy frood
Joined: Jan 2003
Posts: 2,523 |
If multiple spaces are part of the 016 reply, they wouldn't be in $2- in the first place. $right($rawmsg,- $+ $pos($rawmsg,:,2)) or $regsubex($rawmsg,/(?:\S+ ){3}:/,) should have the spaces intact so it can be used instead of $2-.
Edit: minor correction. Also, the shorter $deltok($rawmsg,1,58) could be used instead, but that relies on the assumption that there won't be any multiple/trailing colons in $2-. The previously mentioned alternatives are more general/safe.
Last edited by qwerty; 22/06/07 10:24 PM.
/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
|
|
|
|
Joined: Jun 2007
Posts: 10
Pikka bird
|
OP
Pikka bird
Joined: Jun 2007
Posts: 10 |
doens´t work too... the spaces are not at the dialog, all three strings don´t work 
[url=irc://irc.dream-irc.de][url=irc://irc.dream-irc.de][url=irc://irc.dream-irc.de][url=irc://irc.dream-irc.de]irc://irc.dream-irc.de[/url][/url][/url][/url]<- small,cute Network http://irc-security.no-ip.org IRC-Security
|
|
|
|
Joined: Feb 2003
Posts: 3,432
Hoopy frood
|
Hoopy frood
Joined: Feb 2003
Posts: 3,432 |
I'm not good that this part of scripting, how ever if you try inc $chr(32) for every line, then return the result to the dialog? or maybe $chr(160) is bether?  atlest it's an idea 
if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
|
|
|
|
Joined: Sep 2005
Posts: 2,881
Hoopy frood
|
Hoopy frood
Joined: Sep 2005
Posts: 2,881 |
alias makebinarystring { return $regsubex($1,/(.)/g,$asc(\t) $+ $chr(32)) }
dialog map {
title "Network map"
size -1 -1 300 300
list 1, 0 0 300 300, size vsbar
}
raw 015:*:{
bset &data 1 $makebinarystring($mid($rawmsg,$calc($pos($rawmsg,:,2) + 1))) 13 10
bwrite $qt($scriptdir $+ map.dat) -1 -1 &data
haltdef
}
raw 017:*:{
if (!$dialog(map)) { dialog -m map map }
did -r map 1
loadbuf -o map 1 $qt($scriptdir $+ map.dat)
.remove $qt($scriptdir $+ map.dat)
haltdef
}
raw 018:*:{ haltdef } This works fine, I've tested it. If you still can't get it working then raw numerics probably differ for your network.
|
|
|
|
Joined: Jun 2007
Posts: 10
Pikka bird
|
OP
Pikka bird
Joined: Jun 2007
Posts: 10 |
raw 006:*: {
if ($dialog(nwmngmt)) {
echo -a beeeeeeeeeeeeeeeeep
bset &data 1 $makebinarystring($mid($rawmsg,$calc($pos($rawmsg,:,2) + 1))) 13 10
bwrite $qt($scriptdir $+ map.dat) -1 -1 &data
haltdef
}
}
raw 007:*: {
if ($dialog(nwmngmt)) {
echo -a beeeep
did -r nwmngmt 1
loadbuf -o nwmngmt 1 $qt($scriptdir $+ map.dat)
.remove $qt($scriptdir $+ map.dat)
haltdef
}
} With the map dialog it works but not with my dialog, ID is correct and it´s an listbox too. The beeep´s are echoed. I can select at the listbox the lines, but there is no text in it. At the map.dat are just empty lines. @Khaled: The next mIRC Version should get an option where you can switch between permanent removing spaces before strings and not removing them ;-)
Last edited by mihpares; 23/06/07 11:00 AM.
[url=irc://irc.dream-irc.de][url=irc://irc.dream-irc.de][url=irc://irc.dream-irc.de][url=irc://irc.dream-irc.de]irc://irc.dream-irc.de[/url][/url][/url][/url]<- small,cute Network http://irc-security.no-ip.org IRC-Security
|
|
|
|
|