Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2002
    Top Secret

    need a little php help here

    Ok, so, I've been on the warpath, trying to get this aimbot setup and ready for my use. So far, it's been a great learning experience, but I'm a bit stumped as to how to do one little thing, maybe someone with more php experience can help here.

    So far, I've got an interactive bot setup, responding to certain commands from me only (as $master), and certain commands from valid users. This isn't a big problem, in fact it's been functioning like that for a few weeks. I've got alerts being sent out, which is just how I want it.

    The problem in this case is the bot itself.
    Over time, code changes. Since this file is called through php -q filename filedir, it's loaded into the system dynamically, always running, no html vars or anything else.
    What I'd LIKE to do is send a command to the bot, say "logoff", have it reload the file then die. This way, it automatically adjusts to the file changes without having to call die(), login to the shell then call the file via php again.
    The current code for doing this (note: it IS messy, not exactly the best I'm sure, that's why I'm posting this )
    case 'logoff':
    if (ismaster($whosent))
    $b->send_im($whosent,"As you wish $whosent, logging off now. Please don't make me log off again!");
    system("$phploc -q $thisfile $thisdir");
    Now, this does this somewhat, but it doesn't. What this specific code will do is spawn the php -q inside of the current process, so I end up with something like this:
    ~/monitor/aim ps xua | grep aimbot -c
    ([email protected] 18:05:47):
    7 aimbots running around on the loose. Of course, this means the bot is logged into aim 7 times, which has to be causing serious fits for the aim server.

    My question:
    Is there a better way to approach this? Of course, it's not too hard to login to the server and actually start the bot, but part of the idea for this is to have this done automatically with the logoff command.
    WHMCS Guru - WHMCS addons, management, support and more.
    WHMCS Notifications Extended - Add slack, hipchat, SMS, pushover to WHMCS !!
    Always looking for Linux, WHMCS, Support Desk work. PM for details

  2. #2

    without yet considering other ways to approach the problem in general,
    might first try just adding a second argument (the integer reference for
    "return_val") to your system() call. This will force the called process to run
    synchronously - caller will wait for it to return - seems like that's what you
    are looking to do.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts