Results 1 to 4 of 4
  1. #1
    JamesRo's Avatar
    Join Date
    Apr 2012
    Gender
    male
    Posts
    1,876
    Reputation
    166
    Thanks
    16,130
    My Mood
    Happy

    [Source]VERY simple username grabber

    It's a bit faster than the other versions.

    Code:
    import flash.net.FileReference;
    import flash.utils.ByteArray;
    import fl.data.DataProvider;
    
    userGrab.addEventListener(MouseEvent.CLICK, getUserNames);
    function getUserNames(e:Event)
    {
    	var allP:Object = Game.world.getAllAvatarsInCell();
    	for each(var o:Object in allP)
    	{
    		userList.dataProvider.addItem({label: o.pMC.pname.ti.text});
    	}
    	for(var i:int = 0; i<userList.dataProvider.length; i++)
    	{
    		trace("[Grabber]: Removing <AFK>");
    		userList.dataProvider.getItemAt(i).label = userList.dataProvider.getItemAt(i).label.split("<AFK> ").join("");
    	}
    }
    userSave.addEventListener(MouseEvent.CLICK, saveList);
    function saveList(e:Event)
    {
    	trace("[User List]: Saving current users");
    	var filefilter1:FileReference = new FileReference();
    	var names:ByteArray = new ByteArray();
    	names.writeInt(31);
    	names.writeObject(userList.dataProvider.toArray());
    	filefilter1.save(names, "New User List.ulist");
    	trace("[User List]: Done");
    					 
    }
    deleteDupes.addEventListener(MouseEvent.CLICK, removeDuplicates);
    function removeDuplicates(e:Event)
    {
    	var dataProv2:Array = userList.dataProvider.toArray();
    	RemoveDupes(dataProv2);
    	userList.dataProvider = new DataProvider(dataProv2);
    }
    function RemoveDupes(a:Array)  
    {  
        var i: int;  
        var j: int;  
        for (i = 0; i < a.length - 1; i++)  
        {  
             for (j = i + 1; j < arrary.length; j++)  
             {  
                 if (a[i].label === a[j].label)  
                 {  
                   a.splice(j, 1);  
                 }  
             }  
        }  
    }
    //Credits to Lars Blåsjö for the dupe removal function

  2. The Following User Says Thank You to JamesRo For This Useful Post:

    Darakath (02-06-2014)

  3. #2
    Timii's Avatar
    Join Date
    Aug 2013
    Gender
    male
    Location
    Winterfell
    Posts
    837
    Reputation
    98
    Thanks
    5,046
    My Mood
    Devilish
    Quote Originally Posted by JamesRo View Post
    It's a bit faster than the other versions.

    Code:
    import flash.net.FileReference;
    import flash.utils.ByteArray;
    import fl.data.DataProvider;
    
    userGrab.addEventListener(MouseEvent.CLICK, getUserNames);
    function getUserNames(e:Event)
    {
    	var allP:Object = Game.world.getAllAvatarsInCell();
    	for each(var o:Object in allP)
    	{
    		userList.dataProvider.addItem({label: o.pMC.pname.ti.text});
    	}
    	for(var i:int = 0; i<userList.dataProvider.length; i++)
    	{
    		trace("[Grabber]: Removing <AFK>");
    		userList.dataProvider.getItemAt(i).label = userList.dataProvider.getItemAt(i).label.split("<AFK> ").join("");
    	}
    }
    userSave.addEventListener(MouseEvent.CLICK, saveList);
    function saveList(e:Event)
    {
    	trace("[User List]: Saving current users");
    	var filefilter1:FileReference = new FileReference();
    	var names:ByteArray = new ByteArray();
    	names.writeInt(31);
    	names.writeObject(userList.dataProvider.toArray());
    	filefilter1.save(names, "New User List.ulist");
    	trace("[User List]: Done");
    					 
    }
    deleteDupes.addEventListener(MouseEvent.CLICK, removeDuplicates);
    function removeDuplicates(e:Event)
    {
    	var dataProv2:Array = userList.dataProvider.toArray();
    	RemoveDupes(dataProv2);
    	userList.dataProvider = new DataProvider(dataProv2);
    }
    function RemoveDupes(a:Array)  
    {  
        var i: int;  
        var j: int;  
        for (i = 0; i < a.length - 1; i++)  
        {  
             for (j = i + 1; j < arrary.length; j++)  
             {  
                 if (a[i].label === a[j].label)  
                 {  
                   a.splice(j, 1);  
                 }  
             }  
        }  
    }
    //Credits to Lars Blåsjö for the dupe removal function
    You won't mind me adding that feature on my release, will you? With the credits, of course.

  4. #3
    JamesRo's Avatar
    Join Date
    Apr 2012
    Gender
    male
    Posts
    1,876
    Reputation
    166
    Thanks
    16,130
    My Mood
    Happy
    Quote Originally Posted by Timii View Post
    You won't mind me adding that feature on my release, will you? With the credits, of course.
    Of course not, go ahead!

  5. #4
    Anti's Avatar
    Join Date
    Feb 2011
    Gender
    male
    Location
    here, sadly
    Posts
    6,623
    Reputation
    1354
    Thanks
    1,241
    Sounds good to me.

Similar Threads

  1. [Source Code] VERY Simple MySQL Register/Login System [With Source Code and Required Mysql Files]
    By consca in forum Visual Basic Programming
    Replies: 7
    Last Post: 06-02-2012, 07:15 AM
  2. Will buy hacks for very simple game
    By newbiespark in forum Suggestions, Requests & Help
    Replies: 2
    Last Post: 01-17-2009, 07:05 AM
  3. [Virus source] A simple windows exploit.
    By tednugget in forum C++/C Programming
    Replies: 4
    Last Post: 01-04-2008, 05:13 PM
  4. Very simple WR Hack
    By akilli in forum WarRock - International Hacks
    Replies: 13
    Last Post: 07-25-2007, 10:25 PM
  5. Very simple WR Hack
    By akilli in forum WarRock - International Hacks
    Replies: 4
    Last Post: 07-25-2007, 08:48 PM