mIRC Home    About    Download    Register    News    Help

Print Thread
#97570 13/09/04 10:35 PM
Joined: Sep 2004
Posts: 129
W
Wragg Offline OP
Vogon poet
OP Offline
Vogon poet
W
Joined: Sep 2004
Posts: 129
hi all !

i wanted to make server info stored in .txt because in ini it wouldnt work good coz i intended to stored text load with loadbuf in @window (so in ini it wouldnt work)

and i made this (for now):

;Server Info Feedback
raw 002:*:{
.write -cl1 $server $+ .txt
.write -l1 $server $+ .txt Server Info
.write -l2 $server $+ .txt $chr(160)
.write -l3 $server $+ .txt - Server is $6- of IRCD.
haltdef
}
raw 003:*:{
.write -l4 $server $+ .txt - $2-
.write -l5 $server $+ .txt $chr(160)
haltdef
}
raw 005:*:{
haltdef
.set %and $chr(38)
if (%hash isincs $2) {
.write -l6 $server $+ .txt Normal Channel Types (#) are supported by this server.
.write -l7 $server $+ .txt $chr(160) to join such channel type /join #channelname (or /j channelname).
.write -l10 $server $+ .txt $chr(160)

}
if (%hash $+ %and isincs $2) {
.write -l6 $server $+ .txt - Normal and Special Channel Types (# and &) are supported by this server.
.write -l7 $server $+ .txt $chr(160) to join such channels type:
.write -l8 $server $+ .txt $chr(160) Normal Channel: /join #channel (or /j channel).
.write -l9 $server $+ .txt $chr(160) Special Channel: /join &channel (or /j &channel).
.write -l10 $server $+ .txt $chr(160)
.unset %and
}
.set %cpx1 (ov)@+
.set %cpx2 (ohv)@%+
if (%cpx1 isincs $3) {
.write -l11 $server $+ .txt - Server supports Op and Voice (+o and +v) channel-oper modes.
.unset %cpx1
.unset %cpx2
}
if (%cpx2 isincs $3) {
.write -l11 $server $+ .txt - Server supports Op, Halfop and Voice (+o, +h and +v) channel-oper modes.
.unset %cpx1
.unset %cpx2
}
.write -l12 $server $+ .txt - Server supports $modespl mass modes in channel (op's, halfop's, voice's, ban's).
.set %cm.tmp $gettok($4,2-,44)
.write -l13 $server $+ .txt - Channel modes supported by this server: %cm.tmp
.unset %cm.tmp
.set %txt.tmp MAXBANS=
if (%txt.tmp isincs $11) {
.write -l14 $server $+ .txt $chr(160)
.set %mbl $11 | .set %mbl2 %mbl $+ =1 | .set %mbl.tmp $gettok(%mbl2,2-,61)
.write -l15 $server $+ .txt You can ban (+b) maximum %mbl.tmp users per channel.
}
}

and i intend to add more but i stucked with this last $11 in raw 005

when i connect it is all saved in $server $+ .txt form
and this is result:

Server Info
 
- Server is running version u2.10.11.04+asuka(1.0.6a) of IRCD.
- This server was created Sun Nov 2 2003 at 21:40:56 CET
 
- Normal Channel Types (#) are supported by this server.
to join such channel type /join #channelname (or /j channelname).

 
- Server supports Op and Voice (+o and +v) channel-oper modes.
- Server supports 12 mass modes in channel (op's, halfop's, voice's, ban's).
- Channel modes supported by this server: k,l,imnpstrDcCNu

BUT i cannot extract info from MAXBANS and if that is stucked then other info will stuck too like: MAXCHANNELS NICKLEN TOPICLEN etc...

i tried with:

if (%txt.tmp isincs $11)
if (%txt.tmp isincs $11-)
if (%txt.tmp isin $11)
if (%txt.tmp isin $11-)

but on conect /write command doesnt write anything to TXT and i have some problems with gettok and simmiliar commands coz i dont know how to use them "professionally" frown

so if anyone can help me out i would apreciate it

#97571 13/09/04 10:45 PM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Quote:
coz i intended to stored text load with loadbuf in @window (so in ini it wouldnt work)


From the help file: /loadbuf [lines] [-pirsgleopcnmNt<topic>] <window | dialog id> <filename>

The -t switch loads the text under the [topic] section in an INI or plain text file.

Greets



Gone.
#97572 13/09/04 11:07 PM
Joined: Sep 2004
Posts: 129
W
Wragg Offline OP
Vogon poet
OP Offline
Vogon poet
W
Joined: Sep 2004
Posts: 129
well main problem still exist used i INI or not...

#97573 19/09/04 09:50 PM
Joined: Sep 2004
Posts: 8
R
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
R
Joined: Sep 2004
Posts: 8
I created the following file
[MOTDINFO]
MAXBANS=60
MAXCHANNELS=10
NICKLEN=30
TOPICLEN=307
KICKLEN=307

from this code:
RAW 005:* {
if (MAXBANS isin $1-) {
set %maxbans $matchtok($1- ,MAXBANS,1,32)
writeini SERVERSTAT.ini MOTDINFO MAXBANS $gettok(%maxbans,2,61)
}
if (MAXCHANNELS isin $1-) {
set %maxchannels $matchtok($1- ,MAXCHANNELS,1,32)
writeini SERVERSTAT.ini MOTDINFO MAXCHANNELS $gettok(%maxchannels,2,61)
}
if (NICKLEN isin $1-) {
set %nicklen $matchtok($1- ,NICKLEN,1,32)
writeini SERVERSTAT.ini MOTDINFO NICKLEN $gettok(%nicklen,2,61)
}
if (TOPICLEN isin $1-) {
set %topiclen $matchtok($1- ,TOPICLEN,1,32)
writeini SERVERSTAT.ini MOTDINFO TOPICLEN $gettok(%topiclen,2,61)
}
if (KICKLEN isin $1-) {
set %kicklen $matchtok($1- ,KICKLEN,1,32)
writeini SERVERSTAT.ini MOTDINFO KICKLEN $gettok(%kicklen,2,61)
}
}

to get the values back from the new INI file, use this style of call.
/echo -a $readini(SERVERSTAT.ini,MOTDINFO,MAXBANS)

I hope that helps you with your script.



Albert Ramnath
WinChat IIRC
http://routing.winchat.net

Link Copied to Clipboard