Page 1 of 2 12 LastLast
Results 1 to 25 of 29

Thread: Scar Server Tool

  1. #1
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default Scar Server Tool

    I Currently Need beta Testers!
    and someone to optimize the sst.scar.

    Please Reply in this Thread if you can help me out, i would be glad .

    Introduction:
    I'm introducing my latest addition to scar : D...
    With this Server tool the following things will be possible with scar.

    • Bots that Communicate with each other
    • Scripts that Help Each other. Ie. One Player Mines, the other one only banks.
    • A Chat Client With Scar
    • Scar Games With Multiplayer(network) Feature
    • Basicly anything that requires 2 (or more) scar clients to connect with each other via ip.


    Setup:
    Super Easy!.
    - Copy the sst.scar to your scar/includes Folder
    - thats it.

    Usage:
    1. Run SST.exe, Click on Start Server

    2. Include the sst.scar in your Script.

    You can currently use the following functions with sst.scar.
    SstSend(string):
    Sends a Variable to the Server.

    SstGet(string):
    Receives a Variable From the Server.

    More... See Example..

    Example Code:
    scar Code:
    program ScarServerExample;
    {.include sst.scar}
    var
      status : string;
    begin
      SstIp := '127.0.0.5'; // If this is not set, it will connect to 127.0.0.1
      SstDebug := TRUE; // Use Server Debug

      SstSend('d=9');  // This sends data(var d=9) to the server.
     
      If SstExists('d') then  //SstExists checks if the variable is known. Results True If available.
      status := SstGet('d'); // This Gets Data(var d) From the Server and saves it to status.

      WriteLn(status);  // Output var d
     
      SstDelete('d'); // Deletes var d from the server. Returns TRUE if successful, False if not.

    end.

    Info:
    So, what this server technically does is managing the variables it receives through SstSend(x=y :string);, and Sending the Requested Vars back.
    On the programme interface the "Connect to Server" Feature, can be used to directly change Vars the script is using. For example, if you want to tell the script to go Banking, you can do it directly that way.

    Conclusion:
    I hope you appreciate my effort, and would be grateful if anyone supports me with this project( Debugging, testing, improving the .scar include)

    This is in Alphastate, so dont yell at me if something doesnt work as smoothly as it could : D...
    Though i did some testing, and didnt spot many problems yet.

    Feel Free to offer Suggestions for the next version .


    //UPDATES
    V0.2
    - Quickfix for the Send Data Button o_o;;.

    V0.3
    - Functionality to the "Check for updates" button added.
    - Updated sst.scar (Thanks ShuttleU)
    - Minor Bugfixes.

    V0.4
    - Added SstExists Function to Server and .scar file
    This will check if the server knows a var and results TRUE if its known.
    - Improved sst.scar
    - More Debug Functions
    - Bugfixes...
    - New Example Code
    - Examples Folder Added

    V0.5
    - Bug that caused an exception when accesing server for the first time fixed
    - Hopefully all other major bugs fixed
    - Added SstDelete(string)., Deletes a given Var. Returns TRUE if succesfully, FALSE if not.
    - Added a chat.script as example

    V0.6
    - Minor Bugs fixed
    - Port Selection
    - sst.scar improved(No more access violation when the server is not running)
    - Example scripts updated

    ~caused
    Last edited by caused; 08-16-2009 at 10:21 PM.

  2. #2
    Join Date
    Feb 2009
    Posts
    1,447
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

  3. #3
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

  4. #4
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default

    Trilez: Thanks ALOT! . I'm eager to see what you will create .
    Get the newer Version i just uploaded though .

    ShuttleU: Thanks, feel free to betatest it (Newer Version (0.2)) available!.
    Scarintermessaging is bound to one pc.

  5. #5
    Join Date
    Feb 2009
    Posts
    1,447
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

  6. #6
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default

    Quote Originally Posted by TRiLeZ View Post
    What port does it use?
    I need to port forward and most other people will need too.
    Port 123 .

    Good Point Though. I'll add an feature for selecting the Port.

  7. #7
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    change it to 80

    ~shut

    EDIT: replce sst.scar with this
    SCAR Code:
    function Connect(mycon : Integer):Integer;
    begin
      mycon := OpenConnection('127.0.0.1',123,1500);
      WriteLn(mycon);
      if mycon = -1 then
        WriteLn('Server not Started!');
      result := mycon;
    end;

    function sstsend(scardata : string):boolean;
    var
      mycon : integer;
    begin
      mycon := Connect(mycon);
      if IsConnectionOpen(mycon) then
      begin
        SendConnectionData(mycon,scardata+#10);
        WriteLn('data sent');
        Result:= True;
      end;
    end;

    function sstget(scardata : string):String;
    var
      mycon : integer;
      databuff : string;
    begin
      mycon := Connect(mycon);
      if IsConnectionOpen(mycon) then
      begin
        Insert('get=',scardata,0); //serversyntax
        SendConnectionData(mycon,scardata+#10);
        ReadConnectionData(mycon,databuff);
        databuff := copy(databuff,0,Pos(#13,databuff)-1);
        WriteLn('Received vardata: '+databuff);
        result:=databuff;
      end;
    end;
    Last edited by Shuttleu; 07-21-2009 at 08:17 AM.

  8. #8
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default

    Nah, Port 80 is my Webserver : D...

    Thanks for the Standards =).. I will need to improve the Performance though... and adding exceptions for everything ...

    If anyone wants to do that ?

  9. #9
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    Quote Originally Posted by caused View Post
    Nah, Port 80 is my Webserver : D...

    Thanks for the Standards =).. I will need to improve the Performance though... and adding exceptions for everything ...

    If anyone wants to do that ?
    Port 80 is also what you're using right now to browse the internet. It can be used for more than one thing.

  10. #10
    Join Date
    Feb 2009
    Posts
    1,447
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    I may not be able to test that much because my router is messed up and port forwarding dosnt really work. =/

  11. #11
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default

    Quote Originally Posted by TRiLeZ View Post
    I may not be able to test that much because my router is messed up and port forwarding dosnt really work. =/
    You can test it local =).

    Or send me your scripts

    senrath: I've had some bad experiences with Port 80. I'll stick to 123 for now and add a Feature to select your favourite Port in later versions

  12. #12
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    Assuming that, at heart, the exe is just a listening/server socket? If so, sharing sauce shouldn't be a problem. SRL loves open sauce

    Using an exe to bypass Scar's lack of listening sockets is a bit overkill though and I have used it before for testing purposes (I don't use it for anything since I don't expect people to want to run an exe for a bit of functionality, so usually use a php server as a medium if need be), but adding a native one makes a lot more sense, though I have tried and failed introducing one through a plugin a couple of times.
    By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.

  13. #13
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

  14. #14
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default

    New Version!.

    V0.4
    - Added SstExists Function to Server and .scar file
    This will check if the server knows a var and results TRUE if its known.
    - Improved sst.scar
    - More Debug Functions
    - Bugfixes...
    - New Example Code
    - Examples Folder Added
    I also added an example code, that shows you how to move the Mouse on another PC.
    Basicly this is the first step to a programme that allows remote maintenance .

    mixster: I'll add the sauce once its tasty : D.

    ShuttleU: Yeah, Port 80 is coming soon =)...

    ~caused

  15. #15
    Join Date
    Mar 2007
    Posts
    3,116
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    I did this a long time ago, just with php.
    http://www.villavu.com/forum/showthread.php?t=36546

    edit: After reading all that code, I would have done it a WAY different way. Maybe I will rewrite it...

  16. #16
    Join Date
    Feb 2006
    Location
    Helsinki, Finland
    Posts
    1,395
    Mentioned
    30 Post(s)
    Quoted
    107 Post(s)

    Default

    Wow, good work, caused!

    This looks very promising project so far.

  17. #17
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default

    Update! I call this the first "stable" version. Since i didnt find any bugs yet. So it's ready for use with any script .

    Updates in 0.5
    V0.5
    - Bug that caused an exception when accesing server for the first time fixed
    - Hopefully all other major bugs fixed
    - Added SstDelete(string)., Deletes a given Var. Returns TRUE if succesfully, FALSE if not.
    - Added an Chat.script as example.

    MylesMadness: Cool. A php server is another great idea =). Though not everyone has one. But a php server is optimal for stats and stuff i guess =).

    Janilabo: Thanks ALOT. Feel free to test it out, it seems to be stable now .

  18. #18
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    EDIT: Misunderstood shit
    Last edited by n3ss3s; 07-22-2009 at 11:32 PM.

  19. #19
    Join Date
    Mar 2007
    Posts
    3,116
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by n3ss3s View Post
    This isn't anything new guys... Only way I see this differs from just using OpenConnection and Send/ReadConnectionData is that it has cool writelns?

    Sorry m8... Btw what's the EXE for?
    I think scar talks to that and that goes to the Internet.

  20. #20
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default

    Nah, it stores the data it receives and handles requests =)..

    Didnt have the time to finish the update i planned for today .. Too much work T_T...

    Anyways...., huge.. and probably last update soon ! =)

  21. #21
    Join Date
    Feb 2006
    Posts
    3,044
    Mentioned
    4 Post(s)
    Quoted
    21 Post(s)

    Default

    This looks cool I hope that someone will find this usefull ( i think someone will ) !
    But anyways, good job matey.

    ~Home

  22. #22
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default

    Thanks Home :'D.. I Hope so too.. anyways.. I gotta start using it when my army is done =).

    Update. Probably the last one. If you find bugs i'll fix em though.
    Port 80 for those who requested it added .

    V0.6
    - Minor Bugs fixed
    - Port Selection
    - sst.scar improved(No more access violation when the server is not running)
    - Example scripts updated

  23. #23
    Join Date
    Nov 2008
    Location
    Melbourne, Australia
    Posts
    2,240
    Mentioned
    3 Post(s)
    Quoted
    11 Post(s)

    Default

    Make one work on Ubuntu?
    Click here to find out how to get full screen without members! | Click here to check out my Ultimate Bitmap Tutorial! Edited to work with Simba! |

  24. #24
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default

    Quote Originally Posted by cycrosism View Post
    Make one work on Ubuntu?
    hmn.. i may recompile it for Linux.

    Did you try Wine ?.

    ~caused

  25. #25
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    I would assume it would work with Wine and unless it didn't, I wouldn't see a need to recompile for Linux.
    Oh and you should write down about the protocol you use for it or release the sauce already
    By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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