mIRC Error Posting

By Lozo on Aug 08, 2014

Requested script snippet by Truk, very interesting question

[14:55:45] <@Truk> Is it possible to in a script do something like echo This $ScriptFileName fired
[14:55:48] <@Truk> This would help determine what script fired to find errors. yes i have "unknown command"s that show in status once in a while and this would help TS greatly

This is a short example snippet I made to report script errors, you can change it so it posts in specific channels or that channel or make it write to a log text file.

You can clearly see my error in this script:
if ($nick iso $chan) {
should be
if ($nick isop $chan) {

As this error is there, when you run the !plop command, it will return the if line error message in the channel, $error will return the error message as you see it in the status window when you make script errors.

When the script is fixed and no other errors are found, $error will return as $null and will not return anything.

Example:
[15:11:17] <@LozoCN-1> !plop
[15:11:17] <@LozoCN> Error: * /if: 'iso' unknown operator (line 5, start-connect.ini)

Enjoy! and I appreciate followers on Hawkee and my Social Media Accounts, comments welcome, but if you don't like how its written and you have something which does the exact same thing, but written differently, don't bother commenting.

http://twitter.com/LozoCN
http://facebook.com/DJLozoCN

on *:TEXT:!plop:#Dotcomboy17: {
  if ($nick iso $chan) {
    msg $chan Plop!
  }
  :error {
    if ($error != $null) {
      msg $chan Error: $error
    }
  }
}

Comments

Sign in to comment.
WilliamHerndon   -  Jan 18, 2017

cool

 Respond  
devcline   -  Apr 29, 2015

cool learned something new

 Respond  
Nos   -  Aug 10, 2014

add anti flood

on *:TEXT:!plop:#dotcomboy17:{
  if !%flood. && !%flood.. [ $+ [ $nick ] ] {
    if $nick isop $chan {
      set -u10 %flood. on
      set -u15 %flood.. [ $+ [ $nick ] ] on
      msg $chan Plop!
    }
    else {
      .notice $nick error
    }
  }
} 
Lozo  -  Dec 24, 2014

The purpose of this script was to show an example of the $error identifier and how it should be used within a script if the script appears broken.

Sign in to comment

Truk   -  Aug 08, 2014

Thanks Lozo - great little script.

Lozo  -  Aug 08, 2014

No Problem! Glad you asked me this question, it was quite an interesting one and one I didn't mind looking in to.

Sign in to comment

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.