Raw help

By ^Neptune on Sep 29, 2008

Image Load into your remotes (ALT +R) and type /rawhelp, or select "Raw help" by right-clicking anywhere in mIRC and selecting it from the list.

This is a really awesome snippet! This basically displays 6 bits of info about any raw you double click in the list (info, syntax, example, supported by, notes, see also). It offers a really neat interface, with additional options which I'll talk about below. The data is socketed from www.mirc.net.

Here's a brief description of some of the features:

-View categories/hide categories Quite a nice little feature if you're searching for something specific. You can choose from a list of 41 (!) topics and the list will then fill up with the raws associated with that topic. You can show/hide this function by clicking the "View categories/Hide categories" button.

-Message This will message the active channel the raw you're currently looking at. It will message 4 lines (number, info, syntax, example). Useful for when helping someone with a raw.

-View site This will open up mirc.net on the specified raw if you need more verbose information.

-OK Closes the dialog.

-$1 This is a nice little feature that can open a raw very quickly if you know the numeric of it. Simply type /rawhelp numeric to open the dialog on that raw. Example: "/rawhelp 219".

And that's basically it! Bug reports (shouldn't be any) and suggestions are welcome. Please note: don't suggest moving the "Categories" list above the main list and making an "All" option (I'm not doing it).

Thanks to Zmodem for many things. This has been quite a team effort, and a good one at that. Two heads always work better as one.

Also here: http://www.hawkee.com/phpBB2/viewtopic.php?t=18428

Enjoy!

alias between { 
  noop $regex($1,/\Q $+ $2 $+ \E(.*?)\Q $+ $3 $+ \E/gi) 
  return $regml($4) 
}
menu * {
  -
  .Raw help:/dialog $iif($dialog(raw),-v,-m) raw raw 
}
alias htmlfree { return $regsubex($$1-,/^[^<]*>|<[^>]*>|<[^>]*$/g,) }
alias rawhelp { dialog $iif($dialog(raw),-v,-m) raw raw | if ($1) initString raw $1 }
alias initString {
  var %i = $did(raw,1).lines, %t, %v = 0
  while (%i) {
    if ($did(raw,1,%i) == $1-) { did -c raw 1 %i | %v = 1 | break }
    dec %i
  }
  if (!%v) {
    return $input(That was an invalid raw numeric. Please make another selection from the list.,wok6,Invalid Raw Numeric)
  }
  getraw $2
}
alias isbroke {
  var %i = $1
  if ((%i == 212) || (%i == 421) || (%i == 381) || (%i == 305) || (%i == 340) || (%i == 404) || (%i == 408)) return $true
}
alias getraw {
  if ($isbroke($gettok($did(raw,1).seltext,2,32))) { rawload $gettok($did(raw,1).seltext,2,32) }
  else {
    unset %rnum %rawnotez %rawnum %rawnotez %rawsupport %rawread %rawnumread %rawinfo %rawexample %rawsyntax %rawseealso %rinfo
    if ($sock(sockraw)) { sockclose sockraw } 
    set %rawnum $1
    sockopen sockraw www.mirc.net 80
    dialog $iif($dialog(wait),-v,-mo) wait wait
  }
}
alias rawload {
  var %r = $1
  did -ra raw 2 $gettok($broke [ $+ [ %r ] ],1,126)
  did -ra raw 4 $gettok($broke [ $+ [ %r ] ],2,126)
  did -ra raw 6 $gettok($broke [ $+ [ %r ] ],3,126)
  did -ra raw 8 $gettok($broke [ $+ [ %r ] ],4,126)
  did -ra raw 10 $gettok($broke [ $+ [ %r ] ],5,126)
  did -ra raw 16 $gettok($broke [ $+ [ %r ] ],6,126) 
  did -c raw 2,4,6,8,10,16 1
}
alias broke212 { return A series of these are sent in reply to a STATS m request. They contain statistics on the commands a server supports. You must be an IRCop to use this feature on some servers.~212 command uses bytes~212 PRIVMSG 28931 1446042~All~None.~212 (multiple lines), 219 }
alias broke305 { return This is returned when you return from being AWAY. (by setting a blank away reason.)~305 :You are no longer marked as being away~All~This reply does not make any mention of why you were AWAY or for how long, it merely informs you that you are no longer marked as AWAY.~When you set an AWAY message, 306 is returned }
alias broke340 { return Returned when performing a /USERIP lookup on a person.~340 nick :nickname=+user@IP.address~340 Mentality :bleh=+ekg@127.0.0.1~ircu (Undernet), QuakeNet~Some networks have restricted the function to IRC Operators only.~The RAW for a /USERHOST lookup is 302 }
alias broke381 { return This numeric is returned when you successfuly become an IRC operator using the OPER command.~381 :You are now an IRC Operator~381 :You are now an IRC Operator~All~This should be preceded by an automatic usermode change that includes +o or +O. (IRC operator)~None. }
alias broke404 { return Returned when you try to send a message to a channel, but the server refuses to let you send the message due to channel MODE settings. When this reply is returned, nothing is seen on the channel to indicate you attempted to say something.~404 channel :Cannot send to channel~404 #anime :Cannot send to channel~All~Your message can be refused for two reasons- .If a channel is MODE +n, and you are not on the channel, you cannot send a message to it. If a channel is MODE +m, and you are not opped (+o) or voiced (+v) on the channel, you cannot send a message to it.~None. }
alias broke408 { return Returned if you are trying to send control codes to a channel that is set +c.~408 nickname #channel :You cannot use colors on this channel. Not sent: text~408 hantu #mirc.net :You cannot use colors on this channel. Not sent: woohey woogie~DALnet~Only control code blocked by the mode on DALnet is color (ctrl+k) codes.~None. }
alias broke421 { return Returned when you use an IRC command that the server does not recognize.~421 command :Unknown command~421 BLAH :Unknown command~All~Common reasons for this error - Using a command from another network on a server that doesn't support it (such as SILENCE). Misspelling a command. Missing a mIRC alias.~None. }
dialog raw {
  title "Raw help"
  size -1 -1 260 120
  option dbu
  list 1, 2 2 50 99, vsbar size
  edit "", 2, 92 2 165 20, read multi return vsbar
  text "Info:", 3, 55 2 15 8
  edit "", 4, 92 24 165 11, read autohs
  text "Syntax:", 5, 55 24 20 8
  edit "", 6, 92 37 165 11, read autohs
  text "Example:", 7, 55 38 21 8
  edit "", 8, 92 50 165 11, read autohs
  text "Supported by:", 9, 55 51 35 8
  edit "", 10, 92 63 165 25, read multi return vsbar
  text "Notes:", 11, 55 63 17 8
  box "", 12, 0 103 259 1
  button "OK", 13, 225 106 32 12, ok
  button "View site", 14, 191 106 32 12
  edit "", 16, 92 90 165 11, read autohs
  text "See also:", 17, 55 91 35 8
  button "Message", 18, 157 106 32 12
  combo 19, 264 9 55 35, drop
  box "Category", 20, 261 1 62 22
  list 21, 264 27 55 90, vsbar size
  button "View categories", 22, 110 106 45 12
}
on *:dialog:raw:init:0: {
  var %x = 1
  while (%x <= 606) {
    if ($istok(1 2 3 4 5 7 8 211 212 213 214 215 216 217 218 219 221 222 223 224 241 242 243 244 247 248 249 250 251 252 253 254 255 256 257 258 259 263 265 266 271 272 280 281 290 291 292 293 294 298 301 302 303 305 306 307 310 311 312 313 314 315 317 318 319 321 322 323 324 328 329 331 332 333 340 341 346 347 348 349 351 352 353 364 365 366 367 368 369 371 374 375 376 377 378 381 382 391 401 402 403 404 408 405 406 407 409 411 412 413 414 416 421 422 423 431 432 433 436 437 438 439 441 442 443 445 446 451 455 461 462 467 468 471 472 473 474 475 477 478 481 482 483 484 485 491 501 502 510 511 512 513 600 601 602 603 604 605 606,%x,32)) {
      did -a $dname 1 raw $right(000 $+ %x,3)
    }
    inc %x
  }
  var %x = 1, %t = ADMIN,AWAY,CNOTICE,CPRIVMSG,GLINE,HELPOP,INFO,INVITE,ISON,JOIN,KICK,KILL,LINKS,LIST,LUSERS,MAP,MODE,MOTD,NAMES,NICK,NOTICE,OPER,PART,PASS,PING,PRIVMSG,REHASH,SILENCE,STATS,SUMMON,TIME,TOPIC,USER,USERHOST,USERIP,USERS,VERSION,WATCH,WHO,WHOIS,WHOWAS
  while (%x <= $numtok(%t,44)) {
    did -a $dname 19 $gettok(%t,%x,44)
    inc %x
  }
  did -c $dname 19 1
  var %x = 1
  while (%x <= $numtok($raw.admin,44)) {
    did -a $dname 21 raw $gettok($raw.admin,%x,44)
    inc %x
  }
}
alias raw.admin { return 256,257,258,259,423 }
alias raw.away { return 305,306 }
alias raw.cnotice { return 441 }
alias raw.cprivmsg { return 441 }
alias raw.gline { return 280,281,512 }
alias raw.helpop { return 290,291,292,293,294 }
alias raw.info { return 371,374 }
alias raw.invite { return 341,443,482 }
alias raw.ison { return 303 }
alias raw.join { return 328,332,333,353,366,405,439,471,473,474,475,477,485 }
alias raw.kick { return 403,441,482,484 }
alias raw.kill { return 483,484 }
alias raw.links { return 364,365 }
alias raw.list { return 321,322,333 }
alias raw.lusers { return 250,251,252,253,254,255,265,266 }
alias raw.map { return 005,007 }
alias raw.mode { return 008,221,324,329,346,347,348,349,367,368,403,441,442,467,468,472,478,482,484,501,502 }
alias raw.motd { return 372,375,376,377,378,422 }
alias raw.names { return 353,366 }
alias raw.nick { return 298,431,432,433,437,438 }
alias raw.notice { return 403,404,407,411,412,413,414,439 }
alias raw.oper { return 381,491 }
alias raw.part { return 403,442 }
alias raw.pass { return 462 }
alias raw.ping { return 409 }
alias raw.privmsg { return 301,403,404,407,408,411,412,413,414,439 }
alias raw.rehash { return 382 }
alias raw.silence { return 271,272,511 }
alias raw.stats { return 211,212,213,214,215,216,217,218,219,222,223,224,241,242,243,244,247,248,249,250 }
alias raw.summon { return 445 }
alias raw.time { return 391 }
alias raw.topic { return 331,332,333,403,442,482 }
alias raw.user { return 462 }
alias raw.userhost { return 302 }
alias raw.userip { return 307,340 }
alias raw.users { return 446 }
alias raw.version { return 351 }
alias raw.watch { return 602,603,604,605,606 }
alias raw.who { return 315,352,416 }
alias raw.whois { return 301,310,311,312,313,317,318,319,431 }
alias raw.whowas { return 301,314,369,406,431 }
on *:dialog:raw:dclick:1: { getraw $gettok($did(raw,1).seltext,2,32) }
on *:dialog:raw:dclick:21: { 
  getraw $gettok($did(raw,21).seltext,2,32)
  dialog -s $dname -1 -1 520 240
  did -ra $dname 22 View categories
  unset %viewcat
}
on *:dialog:raw:sclick:*: {
  if ($did == 19) {
    did -r $dname 21
    var %x = 1, %y = $did(19).text
    while (%x <= $numtok($eval($chr(36) $+ raw. $+ %y,2),44)) {
      did -a $dname 21 raw $gettok($eval($chr(36) $+ raw. $+ %y,2),%x,44)
      inc %x
    }
  }
  if ($did == 14) {
    if ($lock(run)) {
      noop $input(It appears you have the run setting in your mIRC options $crlf $+ turned off. Please enable it and try again.,uwo,Error!)
    }
    if (!$did(1).sel) {
      noop $input(You have selected no raw to view.,uwo,Error!)
    }
    else {
      run http://www.mirc.net/raw/?view= $+ %rawnum
    }
  }
  if ($did == 18) {
    if (!$did(1).sel) || (!$did(2).text) || (!$did(4).text) || (!$did(6).text) {
      noop $input(It appears there is not enough/no raw information to message.,uwo,Error!) 
    }
    elseif ($window($active) == Status Window) {
      noop $input(You can't send a message to the status window!,uwo,Error!)
    }
    else {
      msg $active Raw: $gettok($did(1).seltext,2,32)
      var %x = 1
      while (%x <= $did(2).lines) {
        set %rinfo %rinfo $did(raw,2,%x).text
        inc %x
      }
      msg $active Information: %rinfo
      msg $active Syntax: $did(4).text
      msg $active Example: $did(6).text
    }
    unset %rinfo
  }
  if ($did == 22) {
    if (!%viewcat) {
      set %viewcat on
      dialog -s $dname -1 -1 653 240
      did -ra $dname 22 Hide categories
    }
    else {
      dialog -s $dname -1 -1 520 240
      unset %viewcat
      did -ra $dname 22 View categories
    }
  }
}
on *:dialog:raw:close:0: { unset %viewcat }
dialog wait {
  title "Please wait"
  size -1 -1 99 11
  option dbu
  text "Please wait while the info is gathered..", 1, 2 2 95 8
}
on *:dialog:wait:init:0: { did -b $dname 1 }
on *:sockopen:sockraw: {
  did -r raw 16,6,10,4,8,2
  sockwrite -n $sockname GET /raw/?view= $+ %rawnum HTTP/1.0
  sockwrite -n $sockname Host: www.mirc.net $+ $crlf $+ $crlf
}
on *:sockread:sockraw: {
  .timerwait 0 1 checkwait
  sockread %rawread
  if (</a><p /> isin $remove(%rawread,$chr(9))) { 
    set %rawinfo $right($nopath(%rawread),-1)
  }
  if (<b>Supported by</b> isin $remove(%rawread,$chr(9))) {
    set %rawsupport $between(%rawread,<b>Supported By</b></span><br />,<br />,1)
  }
  if (<b>Syntax</b> isin $remove(%rawread,$chr(9))) {
    set %rawsyntax $htmlfree($between(%rawread,<b>Syntax</b></span><br />,<br />,1))
  }
  if (<b>Example</b> isin $remove(%rawread,$chr(9))) {
    set %rawexample $between(%rawread,<b>Example</b></span><br />,<br />,1)
  }
  if (<b>See Also</b> isin $remove(%rawread,$chr(9))) {
    inc %rawnumread 
  }
  elseif (%rawnumread == 1) {
    set %rawseealso $htmlfree(%rawread)
    inc %rawnumread
  }
  if (<b>Notes</b> isin $remove(%rawread,$chr(9))) {
    set %rawnotez $iif($regex(notes,%rawread,/<b>Notes</b></span><br />(.+)$/),$regml(notes,1))
  }
  if (%rawseealso) { did -ra raw 16 $iif(%rawseealso,$v1,None.) }
  if (%rawsupport) { did -ra raw 6 %rawexample }
  if (%rawsyntax) { did -ra raw 10 $iif(%rawnotez,$htmlfree($v1),None.) }
  if (%rawexample) { did -ra raw 4 %rawsyntax }
  if (%rawnumread) { did -ra raw 8 %rawsupport }
  if (%rawinfo) { did -ra raw 2 %rawinfo }
}
on *:SOCKCLOSE:sockraw: { did -c raw 16,6,10,4,8,2 1 | unset %raw* | checkwait }
alias checkwait {
  if (!$dialog(raw)) { .timerwait off }
  if (!$dialog(wait)) { .timerwait off }
  if ($did(raw,2).text) && ($did(raw,4).text) && ($did(raw,6).text) && ($did(raw,8).text) && ($did(raw,10).text) && ($did(raw,16).text) {
    if ($dialog(wait)) { dialog -x wait wait }
    .timerwait off
  }
}
Sign in to comment.
GreyFox   -  Mar 15, 2009

With Raw commands, you can change the modes how's look like... :) One of this who can do :)

 Respond  
rhasttaff   -  Oct 06, 2008

very nice! tested and liked ;)

7/10

Jah Bless´´´

 Respond  
Scakk   -  Sep 30, 2008

2) Different ones. Sotimes it shows for one raw while it disappears for the same one. 3) Told you on IRC 5) Cool. 6) Perhaps I wish to copy it down for later use and do not wish to reopen the dialog to get the info. 7) Tis a redundancy though. 8) It stops at "Notes: A " on me.

 Respond  
^Neptune   -  Sep 30, 2008

Actually wait on that fith statement. I'd be prepared to do it for the categories list, but not for the main one. It just doesn't seem like that would be a good idea to me.

Edit: Updated with that idea.

 Respond  
^Neptune   -  Sep 30, 2008

Scakk:

1) Hmm.. doesn't do that for me. I'll try a few alternate "strategies" and see how it goes. 2) Haven't had this error. Is there any error messages, and what raw did that happen on? 3) If you could provide some information on these, or even list them so I can find out about them, I'd be happy to add them in. 4) Removed. 5) Nice idea. I'll do that now. 6) What's the point of that? If you want to see it, you can see it in the dialog. You don't have to message it. :P 7) Well.. it doesn't harm anything. 8) 215 works perfectly well for me.

[quote] Info: A series of these are sent in reply to a STATS i request. Syntax: 215 I ipmask hostmask port class Example: 215 I @204.127.145. NOMATCH 0 3 Supported by: All Notes: A STATS i request (I-lines) lists classes of clients that are allowed to connect to a server. See also: 215 (multiple lines), 219 [/quote]

 Respond  
Scakk   -  Sep 30, 2008

Few issues still.

1) The blinking when loading the info into the dialog is still there for me. 2) The 'Please Wait' popup does not always disappear when it is done putting the info into the dialog. 3) You have not also added the 4/5 raw numerics I mentioned to you. 4) You also have a button and a link to the website which is redundant. 5) Should make it if the 'View Categories' part is open and you choose a raw from the left side it should hide the categories and change the text on the button as needed. 6) Instead of not letting you send the info to the Status Window make it echo there instead so you can see it and not disturb people in a channel. 7) The 'Ok' button is not needed as the Red X does the same thing. 8) I know of at least one raw numeric that does not show all the info in the dialog ( 215 ). There maybe others.

 Respond  
Superior   -  Sep 30, 2008

I really like the code, it's usefull for me! 8/10!

 Respond  
Gummo   -  Sep 30, 2008
 Respond  
NIGathan   -  Sep 30, 2008

Looks pretty good, this could be pretty useful. Ill try it out

 Respond  
napa182   -  Sep 30, 2008

^Neptune said:

I know a few "certain people" have a grudge against me now

lmao no one has a grudge against you. it's just that you tend to annoy the hell out of every one and leach off them. so boo hoo leech boy boo hoo

 Respond  
Gummo   -  Sep 30, 2008

I noticed that and edited my comment, but it was too late. :P

 Respond  
^Neptune   -  Sep 30, 2008

Never did, lol. That comment you made was on the image ^^.

And yeah, I know a few "certain people" have a grudge against me now, but that's just plain unfair. :\

 Respond  
Gummo   -  Sep 30, 2008

I stand by my suggestion.

 Respond  
^Neptune   -  Sep 30, 2008

A 2.2? :-/

 Respond  
Xpl0reR   -  Sep 29, 2008

it would be cool to have an option to enable public triggers on specific channels.

kinda like

?raw who or ?raw #

Nice Code :)

 Respond  
^Neptune   -  Sep 29, 2008

Updated. -No more broken raws crap. -Flashing has been stopped when you load a raw in.

 Respond  
Zmodem   -  Sep 29, 2008

Seems pretty decent, especially the updated one. No more going to a website for broken raw, yes!

 Respond  
napa182   -  Sep 29, 2008

seem's you still need to do alot of work on this thing

ok im with Dan on the rating for this 1/10

 Respond  
Superior   -  Sep 29, 2008

Hmm, it works!

First of all I didn't know that mIRC was providing this information about RAW commands! I was really curious yesterday and I have to say that I like it! I don't have the energy to take a look at the code, but I will later!

 Respond  
^Neptune   -  Sep 29, 2008

Sorry that it got released a bit late.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.