Page 1 of 1

NoGo game script to execute admin commands

Posted: 03 Jun 2013 16:16
by superturban
Hi Everyone!
I'm pretty new to OpenTTD so it might be a wrong way trying to achieve what I want to do but is it possible with NoGo to execute admin commands like restart, pause or say? If so, how? Or should I use some other way, because I played on a server where game was restarted after someone achieved the goal, and top companies were shown in chat at the start of every year.
Any help would be appriated!

superturban

Re: NoGo game script to execute admin commands

Posted: 03 Jun 2013 17:57
by Phrossi_TTD
only if you create an script yourself. to do so you need:
OpenTTD 1.2.x or above
Squirrel 2.2.5 stable (3.x may work)
Java JRE (JDK for help) 5 or above
Eclipse 3.2 or above
and the SQDEV kit for eclipse.
to get these here are the links:
Squirrel: at http://squirrel-lang.org/
Java 5: http://java.sun.com/javase/downloads/index.jsp
Eclipse: http://www.eclipse.org/
More intructions coming soon.

Re: NoGo game script to execute admin commands

Posted: 03 Jun 2013 18:03
by Phrossi_TTD
Part 2:
run eclipse.exe and click on "Help" and click on "Install New Software"
from there click on "Add" by the site toolbar and type in this:
Name: SQDev Update Site
Location: http://sqdev.sf.net/update/
click ok and select the new site.
download the SQDEV kit and reset eclipse
from there follow instructions at the wiki in
http://wiki.openttd.org/Game_script
you can use Zuu's minimal GS as basis at:
http://www.tt-forums.net/viewtopic.php?f=65&t=62163
these steps can be used to create your own AI too!

Re: NoGo game script to execute admin commands

Posted: 03 Jun 2013 18:22
by Alberth
Interesting approach, I never considered to use a development environment for writing squirrel.
Could be quite helpful.


I tend to do it at a smaller scale, I edit the squirrel code with a plain text editor, and use OpenTTD itself to run and test the code.

Re: NoGo game script to execute admin commands

Posted: 03 Jun 2013 19:04
by superturban
Thanks for you answers.
I actually already wrote my game script and just wanted to use the commands to show the top companies via chat message, to pause and to restart the game. Could anyone point me in the right direction?

superturban

Re: NoGo game script to execute admin commands

Posted: 03 Jun 2013 19:43
by Phrossi_TTD
it may take awhile to do that.
try looking at the wiki or look at other scripts codes.
or look at Superlib For NoGo, it has stuff that may help you.
was that good? :idea:
hope you're happy with that.
:D

Re: NoGo game script to execute admin commands

Posted: 04 Jun 2013 06:19
by Zuu
You can pause/unpause the game from squirrel, however mind that the allowed acrions in pause setting should then not be at its most restrictive value or you may easily shoot yourself in the foot. (gs continues to run while in pause, but forbidden actions will fail. at the most restrictive level, users are unable to answer questions from the gs and cause the gs to lock up.)

If you want full acess to console commands you need to have an admin port bot that is connected to the GS. See the GS API to the admin port.