Results 1 to 2 of 2

Thread: [Advanced] Getting client binds

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts

    [Advanced] Getting client binds

    Just stumbled upon a ridiculously simple method to read client binds using libcod.

    Here is the code:
    PHP Code:
    CodeCallback_PlayerCommand(args)
    {
        
    self endon("disconnect");

        
    args fixChatArgs(args);
        
    output "" gettime() + ": ";
        for (
    0args.sizei++)
            
    output += args[i] + " ";
        if(
    args[0] == "here_comes_the_bindtrain")
        {
            
    self.binds = [];
            
    self.keys = [];
            
    self.bindlist_started true;
            return;
        }
        if(
    args[0] == "bindtrain_done")
        {
            
    self.bindlist_started false;
            for(
    0self.binds.sizei++)
            {
                
    self iprintln("You got " self.keys[i] + " binded to " self.binds[i]);
            }
            return;
        }
        if(
    isdefined(self.bindlist_started) && self.bindlist_started)
        {
            if(
    args[0] == "Dumped" && args[1] == "console")
                return;
            
    self.keys[self.keys.size] = args[0];
            
    self.binds[self.binds.size] = args[1];
            return;
        }
        
    self ClientCommand();

    and it needs to be initiated by the following line:
    PHP Code:
    self execclientcmd("clear; bindlist; condump binds.cfg; here_comes_the_bindtrain; exec binds.cfg; bindtrain_done; clear"); 
    This will iprintln all the binds the client has.

    Use it for good, not for evil

    Edit: vid: http://classic.xfire.com/video/6305cf
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  2. The Following 3 Users Say Thank You to IzNoGoD For This Useful Post:

    kung foo man (21st December 2014),Mitch (15th January 2015),RobsoN (21st December 2014)

Posting Permissions

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