mIRC Home    About    Download    Register    News    Help

Topic Options
#103288 - 18/11/04 06:43 PM server info
Wragg Offline
Vogon poet

Registered: 13/09/04
Posts: 129
i dont like doing this, but since i dont know i would like someone to ask to help me with this:

005 Wragg MAP KNOCK SAFELIST HCN MAXCHANNELS=15 MAXBANS=60 NICKLEN=30 TOPICLEN=307 KICKLEN=307 MAXTARGETS=20 AWAYLEN=307 :are supported by this server

005 Wragg WALLCHOPS WATCH=128 SILENCE=15 MODES=12 CHANTYPES=#

what should i do so i can store info from this into a variable

like if MAP is in raw 005 store
%map possible
%maxchannels 15
%nicklen 30
%watch 128
%massmodes 12
%chantype #

i know that this must be done with gettok or something, but i dunno how to script it... i already made little script that "tries" to extract simmiliar settings, but i does not work

well here it is if someone can fix it and add these things above in it:

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)
.set %hash $chr(35)
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 per channel.
.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.
}
}


thing is that half of features dont work and i dunno how to insert others nor to make this work smirk


Edited by Wragg (18/11/04 06:48 PM)

Top
#103289 - 18/11/04 06:54 PM Re: server info
tidy_trax Offline
Hoopy frood

Registered: 02/11/03
Posts: 2327
Code:
;Catch the 005 raw.

raw 005:*:{

  ;Use tokenize so $2- becomes $1-

  tokenize 32 $2-

  ;Loop while $1 exists.

  while ($0) {

    ;If $1 is "are", then exit the event.

    if ($1 == are) { return }

    ;Set variables to the info you like, eg: %MAP Possible, %KNOCK Possible, %NICKLEN 10.

    set $+(%,$gettok($1,1,61)) $iif($numtok($1,61) > 1,$gettok($1,2-,61),Possible)

    ;Use tokenize so $2- becomes $1-

    tokenize 32 $2-
  }
}
_________________________
New username: hixxy

Top
#103290 - 18/11/04 06:57 PM Re: server info
Wragg Offline
Vogon poet

Registered: 13/09/04
Posts: 129
i dont understand what does this script do =(
could you please explain every line ?

Top
#103291 - 18/11/04 07:02 PM Re: server info
tidy_trax Offline
Hoopy frood

Registered: 02/11/03
Posts: 2327
I added some comments to the above post.
_________________________
New username: hixxy

Top
#103292 - 18/11/04 07:09 PM Re: server info
Wragg Offline
Vogon poet

Registered: 13/09/04
Posts: 129
whoa, you are a genie, you made with like 5 lines of code something i would write in 4 pages lol

anyways i am wondering how do you regulate in those variables where it will be number and where it will write "possible" ?

and how to not write this:

%are Possible
%supported Possible
%by Possible
%this Possible
%server Possible

if this can be done ?

Top
#103293 - 18/11/04 07:14 PM Re: server info
tidy_trax Offline
Hoopy frood

Registered: 02/11/03
Posts: 2327
If there's an = (asc 61) in the text, then it sets %<text before => to <text after =>, otherwise it sets it to possible.

Also, I edited the script so that it shouldn't set the extra variables (I forgot ":" doesn't show up in raws, only in /debug)
_________________________
New username: hixxy

Top
#103294 - 18/11/04 07:19 PM Re: server info
Wragg Offline
Vogon poet

Registered: 13/09/04
Posts: 129
thanks tidy !

Top
#103295 - 19/11/04 12:17 AM Re: server info
Wragg Offline
Vogon poet

Registered: 13/09/04
Posts: 129
what if i dont want all this variables to "spam" variables section, what if i want specifited "info"
like here:

WHOX WALLCHOPS WALLVOICES USERIP CPRIVMSG CNOTICE SILENCE=15 MODES=6 MAXCHANNELS=20 MAXBANS=45

and if i letz just say want MODES MAXCHANNELS and MAXBANS only ?

how would i acomplish this ?

Top
#103296 - 19/11/04 12:42 AM Re: server info
tidy_trax Offline
Hoopy frood

Registered: 02/11/03
Posts: 2327
Code:
raw 005:*:{
  tokenize 32 $2-
  if ($wildtok($1-,MODES=*,1,32)) { set %MODES $gettok($ifmatch,2-,61) }
  if ($wildtok($1-,MAXCHANNELS=*,1,32)) { set %MAXCHANNELS $gettok($ifmatch,2-,61) }
  if ($wildtok($1-,MAXBANS=*,1,32)) { set %MAXBANS $gettok($ifmatch,2-,61) }
}
_________________________
New username: hixxy

Top
#103297 - 19/11/04 12:57 AM Re: server info
Wragg Offline
Vogon poet

Registered: 13/09/04
Posts: 129
could you explain this =) ?

like how do you select exactly which info to get ?


Edited by Wragg (19/11/04 12:59 AM)

Top
#103298 - 19/11/04 01:06 AM Re: server info
tidy_trax Offline
Hoopy frood

Registered: 02/11/03
Posts: 2327
/help $wildtok explains it better than I can.
_________________________
New username: hixxy

Top
#103299 - 19/11/04 01:25 AM Re: server info
Wragg Offline
Vogon poet

Registered: 13/09/04
Posts: 129
thank you very much tidy_trax.

Top
#103300 - 20/11/04 05:19 AM Re: server info
Wragg Offline
Vogon poet

Registered: 13/09/04
Posts: 129
ehm... (im an idiot)

how to return info like this:

WHOX WALLCHOPS WALLVOICES USERIP

since nothing of this has a value and i just want to set like:

if USERIP is there, then /set %userip yes

possible ?

Top
#103301 - 20/11/04 07:51 AM Re: server info
tidy_trax Offline
Hoopy frood

Registered: 02/11/03
Posts: 2327
Code:
raw 005:*:{  
  tokenize 32 $2-  
  if ($wildtok($1-,MODES=*,1,32)) { set %MODES $gettok($ifmatch,2-,61) }  
  if ($wildtok($1-,MAXCHANNELS=*,1,32)) { set %MAXCHANNELS $gettok($ifmatch,2-,61) }  
  if ($wildtok($1-,MAXBANS=*,1,32)) { set %MAXBANS $gettok($ifmatch,2-,61) }
  [color:red]if ($findtok($1-,USERIP,1,32)) { set %USERIP Yes }[/color]
}
_________________________
New username: hixxy

Top
#103302 - 20/11/04 05:50 PM Re: server info
Wragg Offline
Vogon poet

Registered: 13/09/04
Posts: 129
thank you so very much !

Top