Thread: JS Scripting

Results 1 to 4 of 4
  1. #1
    The_En|D's Avatar
    Join Date
    Jun 2012
    Gender
    male
    Location
    Stark Industries
    Posts
    856
    Reputation
    18
    Thanks
    468
    My Mood
    Innocent

    JS Scripting

    I got this script but it doesnt recognize the commands i use.... Anybody can tell me what to do?

    Code:
    /**
     * Created by Simon on 18.05.2014.
     */
    
    var ID_TEXT = $.findPacketId("TEXT");
    var ID_PLAYER_TEXT = $.findPacketId("PLAYERTEXT");
    var talking = "" ;
    var boot = false;
    var playertextPacket = event.createPacket(ID_PLAYERTEXT);
    
    function onClientPacket(event) //Here, we handle all the packets we sent to the server
    {
        var packet = event.getPacket();
        switch (packet.id()) {
            case ID_PLAYER_TEXT:
            {
                var text = packet.text.toLowerCase();
                if (text.length() >= 6 && text.substring(0, 6) == "/start")
                {
                    boot = true;
                    talking = text.substring(7);
                    spamify();
                }
    
                else if (text == "/stop")
                {
                    boot = false;
                }
            }
        }
    }
    
    function spamify()
    {
        if(boot)
        {
            var bing = this.rand();
            playertextPacket.text = talking + bing;
            $.sendToServer(playertextPacket);
            $.scheduleEvent(5, "spamify");              // Calls itself in 5 seconds
        }
    }
    
    function rand()
    {
        number++;
        if (number % 2 == 0)
        {
            return ".";
        }
    
        else
        {
            return "!";
        }
    }

    "They say the best weapon is one you never have to fire.
    I respectfully disagree.
    I prefer the weapon you only have to fire once."

    ~ Tony Stark

  2. #2
    CrazyJani's Avatar
    Join Date
    Jan 2013
    Gender
    male
    Posts
    2,475
    Reputation
    170
    Thanks
    15,666
    number is not defined
    Last edited by CrazyJani; 06-04-2014 at 05:00 AM.

  3. #3
    The_En|D's Avatar
    Join Date
    Jun 2012
    Gender
    male
    Location
    Stark Industries
    Posts
    856
    Reputation
    18
    Thanks
    468
    My Mood
    Innocent
    Quote Originally Posted by CrazyJani View Post
    number is not defined
    Thanks already changed this but RealmRelay has a promleb with this line:

    playertextPacket.text = talking + bing;

    Console:

    12:07:42 TypeError: Cannot set property "text" of undefined in <eval> at line number 39
    Last edited by The_En|D; 06-04-2014 at 05:54 AM.

    "They say the best weapon is one you never have to fire.
    I respectfully disagree.
    I prefer the weapon you only have to fire once."

    ~ Tony Stark

  4. #4
    CrazyJani's Avatar
    Join Date
    Jan 2013
    Gender
    male
    Posts
    2,475
    Reputation
    170
    Thanks
    15,666
    Quote Originally Posted by The_En|D View Post
    Cannot set property "text" of undefined
    Take this out from the top:
    Code:
            var playertextPacket = event.createPacket(ID_PLAYERTEXT);
    And insert it into the spamify function:
    Code:
    function spamify()
    {
        if(boot)
        {
            var bing = this.rand();
            var playertextPacket = event.createPacket(ID_PLAYERTEXT);
            playertextPacket.text = talking + bing;
            $.sendToServer(playertextPacket);
            $.scheduleEvent(5, "spamify");              // Calls itself in 5 seconds
        }
    }

  5. The Following User Says Thank You to CrazyJani For This Useful Post:

    IAmDM (06-04-2014)

Similar Threads

  1. Habbohotel Scripts
    By h0ang in forum General Game Hacking
    Replies: 8
    Last Post: 05-18-2007, 05:19 AM
  2. Script
    By Corky in forum WarRock - International Hacks
    Replies: 5
    Last Post: 03-07-2007, 05:28 PM
  3. Script Which Closes Ur Browser On Click
    By AN1MAL in forum Spammers Corner
    Replies: 4
    Last Post: 12-28-2006, 12:39 PM
  4. Replies: 1
    Last Post: 07-05-2006, 06:20 AM
  5. OMG I SO STUCK!!!(Java Script "n" html problem
    By jeremywilms in forum Programming
    Replies: 11
    Last Post: 06-15-2006, 01:23 PM