IRC Script Help

Discussion in 'Scripting' started by dailyinsanity, Aug 2, 2014.

  1. dailyinsanity

    dailyinsanity MDL Junior Member

    Aug 17, 2012
    71
    6
    0
    #1 dailyinsanity, Aug 2, 2014
    Last edited by a moderator: Apr 20, 2017
    Hello,
    I'm not good at IRC scripts, but I would like to know if someone could help me with turning this script basically when someone does !cstats name stat, it would return as a chat inside of the channel like : dailyinsanity: xxxxxxxxxx | instead of myself having to do /cstats name stat so that other people can use it.

    Code:
    alias /cstats {
      sockclose hits
      if ($1 == $null) { echo -at 4Error [use: /cstats <user> <stat>] | halt }
      sockopen hits crazybobs.net 80
      if ($2 == $null) { set %stat ! $+ $1 }
      if ($2 != $null) { set %stat ! $+ $2-
        set %cnruser $1
      }
    }
    on *:sockopen:hits: {
      if $sockerr > 0 { echo -at 4An Error Has Occured Try Again Later | sockclose $sockname | halt }
      sockwrite -n $sockname GET /mrx/webstats/UserStats.php?username= $+ %cnruser HTTP/1.1
      sockwrite -n $sockname Host: crazybobs.net
      sockwrite -n $sockname $crlf
    }
    on *:sockread:hits: {
      if $sockerr > 0 { echo -at 4An Error Has Occured Try Again Later | sockclose $sockname | halt }
      sockread &cb.temp
      set %cb.temp $bvar(&cb.temp,1-).text
      set %cb.temp $replace(%cb.temp,</td>,!,</span>,?,(# others if tied),?!)
      set %cb.temp $remove(%cb.temp,<td>,</td>,</span>,<span>,<tr>,</tr>,<td align='center'>,</th>,<th>,th class='nosort'>,<br/>,</t,>,<,/,$crlf $+ 1000 $+ $crlf)
      if (no username specified isin %cb.temp) { echo -at 4Error [" $+ %cnruser $+ " Not Registered] | sockclose $sockname | unset %stat | halt }
      if (www.statcounter.com isin %cb.temp) { echo -at 4Error [" $+ %stat $+ " Not Found] | sockclose $sockname | unset %stat | halt }
      if ($matchtok(%cb.temp,%stat,1,63) != $null) { var %parse $matchtok(%cb.temp,%stat,1,63)
        var %rank $gettok(%parse,6,33)
        if (span isin %rank) { var %rank $replace(%rank,",$chr(32)) | var %rank $remove(%rank,span style= font-weight:900;font-size:large;color:rgb,;) | var %rank $remove(%rank,$wildtok(%rank,(*),1,32)) }
        msg $active %cnruser $+ 's $gettok(%parse,1,33) LV: $gettok(%parse,2,33) SF: $gettok(%parse,3,33) LS: $gettok(%parse,4,33) total: $gettok(%parse,5,33) rank: %rank
        sockclose $sockname
        unset %stat
        halt
      }
    
    Thanks!
     
  2. jellybelly

    jellybelly MDL Member

    Oct 30, 2009
    159
    29
    10
    the mIRC help file has all the info you need to create what you want

    it's been years since ive done anything but youll want to be looking at the on stuff to trigger events... on *:text: or something like that.. to detect when someone says the keyword you want
     
  3. dailyinsanity

    dailyinsanity MDL Junior Member

    Aug 17, 2012
    71
    6
    0
    I've tried, I've looked all into the documentation of mirc and couldn't find what i was looking for. I even tried to use that text thing. no luck -_-
     
  4. spynonymous

    spynonymous MDL Novice

    May 18, 2016
    9
    1
    0
    Really ! people still join IRC ?

    i thought this was history after facebook , twitter and skype !

    used to have good time , and i remember i used to be on Dalnet and Undernet :D

    Old days , Gold Days ( @ and + ) twitter generation thinks @ is first used by twitter ! well search for OP and Voice :D