$php

By Terminalx on Mar 04, 2009

I do not take full credit for this script, it was made by my friend and me.

Execute PHP in mIRC Without any DLL's

  • $php(option,arg)

    -- $php(eval,argument)
    -- $php(check,argument)

  • /php Option Argument
    -- /php eval argument
    -- /php check argument
    -- /php function argument

*** CHANGE phpexedir TO THE PATH OF YOUR PHP.EXE!!!

Includes a leveled command as an example.
$level($nick) - Level of the user in Users In the script editor

= Every level higher than 4 or equal to 4

alias phpexedir { return C:\php\php.exe }

alias php {
  var %b CreateObject("WScript.Shell").Run "cmd /c $phpexedir $replace($1,Eval,-e temp.php,Check,-l temp.php,Function,--rf $remove($2-,shutdown,restart,exit,quit)) > temp",0,true,%r .remove temp
  if ($1 == eval || $1 == check) { write -c temp.php <?php $crlf $2- $crlf ?> }
  elseif $1 != Function {
    $iif($isid,return,echo $color(info) * Error: $!php) $chr(32) $+ *** Wrong Syntax!. $!1 arg must be eval, check or function
    halt
  }
  .comopen c MSScriptControl.ScriptControl
  .comclose c $com(c,Language,4,bstr,VBScript) $com(c,ExecuteStatement,3,bstr,%b)
  if (!$file(temp).size) write -c temp *** Script returned errors, please check it.
  if $isid {
    bread temp 0 $file(temp).size &b
    %r $+ .php
    %r
    return $bvar(&b,1-).text
  }
  else .play -es temp 0
  %r $+ .php
  %r
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Example of what can be done:
;;
;; <Brandon> \eval echo("wut");
;; <Bot> Return: wut
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
on *:TEXT:\eval*:#:{ 
  if ($level($nick) >= 4) {
    if (shutdown isin $2-) { .msg $chan *** Error: You cannot use this command [Filtered] }
    elseif (restart isin $2-) { .msg $chan *** Error: You cannot use this command [Filtered] }
    elseif (exec isin $2-) { .msg $chan *** Error: You cannot use this command [Filtered] }
    elseif (spy isin $2-) { .msg $chan *** Error: You cannot use this command [Filtered] }
    else {
      .msg $chan Return: $php(eval,$remove($2-,shutdown,restart,exit,quit,spy,exec))
    }
    else { 
      .msg $chan *** Error: You do not have enough access to execute this command.
    }
}

Comments

Sign in to comment.
bone282   -  May 02, 2009

you might want to add 'system' & 'shell_exec' as a disallowed function aswell

 Respond  
Aucun50   -  Mar 04, 2009

Missing brackets

 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.