Author Topic: How to debug scripts?  (Read 1280 times)

0 Members and 1 Guest are viewing this topic.

Offline RunMan

  • Major(1)
  • Posts: 27
How to debug scripts?
« on: April 03, 2008, 09:20:59 am »
Hello!
I wonder, if there is a way to debug our scripts. Server writes what is wrong, and where, but it closes so quick, that I can't read it.

Offline JFK

  • Camper
  • ***
  • Posts: 255
    • My TraxInSpace Account
Re: How to debug scripts?
« Reply #1 on: April 03, 2008, 09:27:25 am »
You can use an pascal IDE such as Free Pascal IDE or DevPascal to get all error messages at once.
However, you will need to ignore a lot of messages since normal pascal doesn't recognize a lot of functions/procedures used by soldat.
If you want to use the build-in soldatserver-compiler, i suggest you run command first : Start->Run->(type:)command
do cd\(yoursoldatserverdir) and start soldatserver. Then you will be able to read the message.

The way i do it is create a script in DevPascal (at least i see where i forgot a ' and such) or just notepad and then *slowly* debug it with the soldat server. I really wonder how other people create/debug their scripts.
Come join: EliteCTF
Listen to: My Music

Offline RunMan

  • Major(1)
  • Posts: 27
Re: How to debug scripts?
« Reply #2 on: April 03, 2008, 10:00:30 am »
I found a method like this: I run server, then ARSEE and put my script into scripts. Then i write /recompile in ARSEE, and I can read what did I did wrong, but copying and deleting script from scripts is very unconfortable ;)

Offline JFK

  • Camper
  • ***
  • Posts: 255
    • My TraxInSpace Account
Re: How to debug scripts?
« Reply #3 on: April 03, 2008, 10:45:21 am »
I found a method like this: I run server, then ARSEE and put my script into scripts. Then i write /recompile in ARSEE, and I can read what did I did wrong, but copying and deleting script from scripts is very unconfortable ;)

Are you trying your scripts on a external server? If that is so, i highly recommend you download soldatserver yourself and first use your scripts on your own computer.
Come join: EliteCTF
Listen to: My Music

Offline RunMan

  • Major(1)
  • Posts: 27
Re: How to debug scripts?
« Reply #4 on: April 03, 2008, 11:07:49 am »
I run server on my computer

Offline Serial K!ller

  • Camper
  • ***
  • Posts: 408
    • Soldat Mods Archive
Re: How to debug scripts?
« Reply #5 on: April 03, 2008, 11:16:08 am »
create a .bat file (notepad) in the server's folder with this in it:
soldatserver.exe
run the .bat and then the window should stay open so you can read the error(s)

Offline RunMan

  • Major(1)
  • Posts: 27
Re: How to debug scripts?
« Reply #6 on: April 03, 2008, 11:30:09 am »
You are awesome, thanks! :)

Offline amb2010

  • Camper
  • ***
  • Posts: 264
  • Fear the dot ...
Re: How to debug scripts?
« Reply #7 on: April 03, 2008, 12:23:26 pm »
Or if you dont feel like doing that you can just go to the logs folder and open the console log and it tells you everything in there.
And as the lyrics go in the United State's national anthem: "America, f**k YEAH!".

Offline JFK

  • Camper
  • ***
  • Posts: 255
    • My TraxInSpace Account
Re: How to debug scripts?
« Reply #8 on: April 03, 2008, 12:26:58 pm »
Mweh, if you make the batfile, you could make it like this:

Code: [Select]
:REPEAT
soldatserver.exe
GOTO REPEAT

Thats how i run it now, every time the server stops, the .bat asks to terminate the batch. Press 'n' and enter and it will start soldatserver again.
Come join: EliteCTF
Listen to: My Music

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: How to debug scripts?
« Reply #9 on: April 03, 2008, 03:00:17 pm »
Mweh, if you make the batfile, you could make it like this:

Code: [Select]
:REPEAT
soldatserver.exe
GOTO REPEAT

Thats how i run it now, every time the server stops, the .bat asks to terminate the batch. Press 'n' and enter and it will start soldatserver again.
Thats cool, I might try that out. Could make things a little quicker for me.

Offline Mercury92

  • Camper
  • ***
  • Posts: 284
Re: How to debug scripts?
« Reply #10 on: April 04, 2008, 12:09:38 pm »
Sorry wrong topic !
[saw]  on 1.5.1