Deprecated: The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence in /home/iano/public_html/tpforums-vb5/forum/includes/class_core.php on line 5842

PHP Warning: Use of undefined constant MYSQL_NUM - assumed 'MYSQL_NUM' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165

PHP Warning: Use of undefined constant MYSQL_ASSOC - assumed 'MYSQL_ASSOC' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165

PHP Warning: Use of undefined constant MYSQL_BOTH - assumed 'MYSQL_BOTH' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165

PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ..../includes/functions_navigation.php on line 588

PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ..../includes/functions_navigation.php on line 612

PHP Warning: Use of undefined constant misc - assumed 'misc' (this will throw an Error in a future version of PHP) in ..../global.php(29) : eval()'d code(6) : eval()'d code on line 1

PHP Warning: Use of undefined constant index - assumed 'index' (this will throw an Error in a future version of PHP) in ..../global.php(29) : eval()'d code(6) : eval()'d code on line 1

PHP Warning: Use of undefined constant misc - assumed 'misc' (this will throw an Error in a future version of PHP) in ..../includes/class_bootstrap.php(1422) : eval()'d code(4) : eval()'d code on line 1

PHP Warning: Use of undefined constant index - assumed 'index' (this will throw an Error in a future version of PHP) in ..../includes/class_bootstrap.php(1422) : eval()'d code(4) : eval()'d code on line 1

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6
Simple LevelSpy
Results 1 to 2 of 2

Thread: Simple LevelSpy

  1. #1

    Simple LevelSpy

    A very simple LevelSpy-Function. Working with the +- on the numpad.
    [code=csharp]
    Client client = Client.GetClients()[0]; // global
    int currentFloorLevel = 0; // global

    KeyboardHook.Enable();

    KeyboardHook.Add(Keys.Subtract, new KeyboardHook.KeyPressed(delegate()
    {
    currentFloorLevel = floor_Down();
    return false;
    }));

    KeyboardHook.Add(Keys.Add, new KeyboardHook.KeyPressed(delegate()
    {
    currentFloorLevel = floor_Up();
    return false;
    }));

    int floor_Up()
    {
    currentFloorLevel += 1;

    if (currentFloorLevel == 0 || currentFloorLevel > 7)
    {
    client.Map.LevelSpyOff();
    currentFloorLevel = 0;
    }
    else
    {
    client.Map.LevelSpyOn(currentFloorLevel);
    }
    return currentFloorLevel;
    }



    int floor_Down()
    {
    currentFloorLevel -= 1;

    if (currentFloorLevel == 0 || currentFloorLevel < -7)
    {
    client.Map.LevelSpyOff();
    currentFloorLevel = 0;
    }
    else
    {
    client.Map.LevelSpyOn(currentFloorLevel);
    }
    return currentFloorLevel;
    }
    [/code]

  2. #2
    Moderator
    Join Date
    Oct 2009
    Posts
    482

    RE: Simple LevelSpy

    http://www.tpforums.org/forum/thread-5165.html

    Hardek already made one.

    However good work
    You should make check if client is active and then process levelspy (well if you're using calculator you have to use buttons in application, not on keyboard).

Posting Permissions

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