1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Hey Guest, is it this your first time on the forums?

    Visit the Beginner's Box

    Introduce yourself, read some of the ins and outs of the community, access to useful links and information.

    Dismiss Notice

KScript - Server Scripting for KAG Classic

Discussion in 'Community Dev Corner' started by master4523, Mar 26, 2013.

Mods: Downburst, Mazey
  1. master4523

    master4523 Masterful KAG Guard Global Moderator Tester
    1. PumpkinStars - [Pk#] - Inactive

    Messages:
    378
    KScript is a tcpr wrapper which lets you interact remotely with the server. It doesn't serve the same purpose as KAG modding. Actually, it can be used in combination with modding. KScript isn't and will never be a modding system.

    @Ramblurr : KAG Beta isn't supported by KScript, I don't really have the time to work on it right now. I'll create a new beta branch on github, feel free to contribute to it.
    Edit: done, https://github.com/master4523/kscript/tree/kag-beta
     
    marcochanyh likes this.
  2. Ramblurr

    Ramblurr Catapult Fodder

    Messages:
    5
    Cool. Since it's just a tcpr wrapper, that means to get it working with KAG Beta, the command parsing needs to be updated, yea? I assume there are new commands or the format of old commands changed. Or are there deeper changes that need to be done to make it Beta compatible?

    I'll take a look at the source, I've never used Node.js. Nifty.
     
  3. master4523

    master4523 Masterful KAG Guard Global Moderator Tester
    1. PumpkinStars - [Pk#] - Inactive

    Messages:
    378
    @Ramblurr : The connection should probably work, the parsing will need some changes. You can also send a line of code via rcon and KAG will execute it. That could be handy if you want to execute remote scripts.
    They've also recently added unicode support, let's see if it fixes the characters issue.
     
    magnum357 likes this.
  4. Yo guys, I have a question. I'm making a mod for boldtemple since i'm working for the now :P I'm really not that accustomed to it yet and I might want a little help making a mod. Basically it goes like this. It's a point bases module. It requires to be able to work on all servers, it has a point system where people when they kill people will get points, kinda like shadow clone and obans. It will then transfer to all there different servers in classic like rp and kingslayer. Anyone have any suggestions? Also if someone would help me learn k-script better I would be really thankfull.
     
  5. SnIcKeRs

    SnIcKeRs Bison Rider

    Messages:
    148
    You can share the same file with stats for all your servers.
     
    Last edited: Jan 8, 2014
  6. Leo

    Leo Haxor

    Messages:
    503
    How you can make status if kill feed doesn't work if I may ask ?
     
  7. sorry can you rephrase that? if your saying that im using a mod that someone made then no, I'm making it entirely new.
     
  8. master4523

    master4523 Masterful KAG Guard Global Moderator Tester
    1. PumpkinStars - [Pk#] - Inactive

    Messages:
    378
    He's using it on a Classic server, not a Beta server
     
  9. Leo

    Leo Haxor

    Messages:
    503
    Oh, my mistake then. This topic is at Beta section and got confused :wink:
     
  10. is this realy beta... ;-;
     
  11. potato14

    potato14 Shopkeep Stealer

    Messages:
    59
    i have this problem how do i solve it DSC_0779.JPG
     
  12. screen shot, you are doing it wrong
     
    LucasTT and VanHuek like this.
  13. Sirpixelot

    Sirpixelot Base Burner
    1. Aphelion's Roleplay

    Messages:
    776
    Pro Tip: Use the PrtSc button.
     
  14. marcochanyh

    marcochanyh Shark Slayer

    Messages:
    19
    Hi,
    i have a question in adding bot using Kscript,
    i have tried to type
    "/rcon addBotX(1,1,'marcobot');"
    into home key > console, but didn't add any bot to my server,
    and i tried to use
    ks.rcon.send(RCON+'addBotX(1,1,\'Marcobot\');');
    although the server also read this command, but is also not working
    (i have already add some bot using addBotX(1,1,'marcobot'); in dedicated_autostart.gm, but cannot use command to add more)
    Do i miss any thing that need to enable , i make something wrong or Kscript is not working for that?
    THanks a lot !!!
     
  15. master4523

    master4523 Masterful KAG Guard Global Moderator Tester
    1. PumpkinStars - [Pk#] - Inactive

    Messages:
    378
    You should use ` instead of ' for quotes
     
  16. marcochanyh

    marcochanyh Shark Slayer

    Messages:
    19
    THANKS A LOTTTT!!!!!!!!!!!!!!!!!!!!!!!!!!! : D :D :D :D ::D:::D:::D:::D:::D:::D:::D:::D:
    i have solving this problem for a long time! :D thanks!
    --- Double Post Merged, Jan 26, 2014, Original Post Date: Jan 26, 2014 ---
    Oh, i got another question,
    Can i receive the bot id or bot when it is killed?
    (playerKilled) can reveive victim, or attaker, but if killed by bot, attacker would be null, same to victim,
    Is this not working yet? or just i don't know how to receive bot data using playerKilled?
    thanks! :wink:
     
  17. master4523

    master4523 Masterful KAG Guard Global Moderator Tester
    1. PumpkinStars - [Pk#] - Inactive

    Messages:
    378
    Unfortunately, bots aren't supported by KScript, but playerKilled shoud return the player name correctly, so you could do something like :
    Code:
    if (attacker != null && victim == null) {
        // The attacker exists (real player) but the victim doesn't (bot ?)
        console.log(attacker.getName() + ' has killed a bot');
    }
    (Note: untested code)
     
  18. marcochanyh

    marcochanyh Shark Slayer

    Messages:
    19
    Thanks a lot!!! ::D: i would try that code, thanks ::):
     
  19. ThailandGamemingGold

    ThailandGamemingGold Ballista Bolt Thrower

    Messages:
    27
    why i have this error

    { [Error: connect ECONNREFUSED] code: 'ECONNREFUSED', errno: 'ECONNREFUSED', syscall: 'connect' } ?

    i try set sv_tcpr = `1`;

    and set ip to 110.171.131.166 but this does not work
     
  20. Mazey

    Mazey Haxor Global Moderator Forum Moderator Staff Alumni Donator Official Server Admin

    Messages:
    1,914
    You can not run the server on Windows.
     
Mods: Downburst, Mazey