How do you use client scripting?
Moderator: Board moderators
-
- Newbie
- Posts: 5
- Joined: Thu Jun 05, 2003 2:17 pm
How do you use client scripting?
I'm trying to figure out a good set of commands for scripts to manipulate the item tabs. Suggestions are very welcome. Also:
What do you have your scripts do?
How do you debug your scripts?
(What language do you write your scripts in?)
What do you think about the script commands we've already got?
Do you have one big monolithic script, or lots of little ones?
Do you run the same script more than once?
Do you have multiple copies of the same script running at the same time?
I'd really love to see people's scripts - consider private-message-thingy if you don't want other people to see them (e.g. keep TC scripting from spreading?)
What do you have your scripts do?
How do you debug your scripts?
(What language do you write your scripts in?)
What do you think about the script commands we've already got?
Do you have one big monolithic script, or lots of little ones?
Do you run the same script more than once?
Do you have multiple copies of the same script running at the same time?
I'd really love to see people's scripts - consider private-message-thingy if you don't want other people to see them (e.g. keep TC scripting from spreading?)
Re: How do you use client scripting?
i have very limited knowledge about scripting, so i'm also interestingKevin Rudat wrote: I'm trying to figure out a good set of commands for scripts to manipulate the item tabs. Suggestions are very welcome.

to do stupid things in large numbersKevin Rudat wrote: What do you have your scripts do?

by reading them again and again and finally trying them. (preferably at localhost)Kevin Rudat wrote: How do you debug your scripts?
bash - i use linux.Kevin Rudat wrote: (What language do you write your scripts in?)
every language should do fine, as long as you have an interpreter for them. Don't ask me about windows, i have absoutely no idea...
phew... there are huge possibilities, but i know little... theoretically it should be possible to create a 'shopping script' some script that searches for something in all shops, but that would require a LOT of workKevin Rudat wrote: What do you think about the script commands we've already got?
just a few little onesKevin Rudat wrote: Do you have one big monolithic script, or lots of little ones?
serial, not paralel. scripting is only useful if you use it more than once (or use it once for a long time, for example to move a lot of items from one part of your appartment to an other part.)Kevin Rudat wrote: Do you run the same script more than once?
Do you have multiple copies of the same script running at the same time?
basically, scripting is a huge keybinding, but more powerful
Bibendi ergo sum
or rather: sum ergo bibendi
or rather: sum ergo bibendi
-
- Newbie
- Posts: 5
- Joined: Thu Jun 05, 2003 2:17 pm
Re: How do you use client scripting?
What do you do if your apartment-reshuffling script walks you into a wall? :)Mith wrote:by reading them again and again and finally trying them. (preferably at localhost)Kevin Rudat wrote: How do you debug your scripts?
What do you do if bash fails?
What do you think of the way your script talks to the client? Would you change anything?Mith wrote:phew... there are huge possibilities, but i know little... theoretically it should be possible to create a 'shopping script' some script that searches for something in all shops, but that would require a LOT of workKevin Rudat wrote: What do you think about the script commands we've already got?
I heard that people run a more intelligent auto-eat script. Wouldn't someone run that and their Apartment Management script at the same time?Mith wrote:serial, not paralel. scripting is only useful if you use it more than once (or use it once for a long time, for example to move a lot of items from one part of your appartment to an other part.)Kevin Rudat wrote: Do you run the same script more than once?
Do you have multiple copies of the same script running at the same time?
-
- Regular
- Posts: 77
- Joined: Thu Jun 17, 2004 2:41 am
- Location: Eastern Coast of the United States
more than one script can be running at the same time.
scripts - lists running scripts, and numbers asociated with them
scriptkill SCRIPTNO (or something like that) - kills the script
as for any errors the script makes, it has to correct them itself
there is some documentation in cvs (not shure about the releases):
client/Documentation/scripting.html , I think ...
scripts - lists running scripts, and numbers asociated with them
scriptkill SCRIPTNO (or something like that) - kills the script
as for any errors the script makes, it has to correct them itself
there is some documentation in cvs (not shure about the releases):
client/Documentation/scripting.html , I think ...
-
- Regular
- Posts: 77
- Joined: Thu Jun 17, 2004 2:41 am
- Location: Eastern Coast of the United States
Ok here are two python scripts I have made, the first one is mostly useless, the seccond issues "use_skill inscription" with lines from a text file.
This one pops up a window, with a button, that when clicked, moves you move north, and then makes you say "blip". After that, the window closes, and the script exits.
NOTE: requires pygtk
This script sends "use_skill inscription" for every line in a text file.
That results in it writing the contents of the textfile in a book, if a book is marked, and the user has the "inscription" skill at the time (usualy gotten by holding a pen). Otherwise it will probaly make the server send a bunch of error messages.
This one pops up a window, with a button, that when clicked, moves you move north, and then makes you say "blip". After that, the window closes, and the script exits.
NOTE: requires pygtk
Code: Select all
#! /usr/bin/env python
import pygtk
pygtk.require('2.0')
import gtk
def hello(fubar):
print("issue 1 1 north")
print("issue 1 1 say blip")
gtk.main_quit()
def main():
window = gtk.Window(gtk.WINDOW_TOPLEVEL)
button = gtk.Button("BLIP!")
button.connect("clicked", hello)
window.add(button)
button.show()
window.show()
gtk.main()
main()
That results in it writing the contents of the textfile in a book, if a book is marked, and the user has the "inscription" skill at the time (usualy gotten by holding a pen). Otherwise it will probaly make the server send a bunch of error messages.
Code: Select all
#! /usr/bin/env python
#writes books from a text file
#replace "FILEHERE" with the path to the text file
file = "FILEHERE"
fileobject = open(file, "r")
#Each string in this list has a newline char on the end #except for the last one, this combined with "print"
#adding a newline also, works, but seems unclean
lines = fileobject.readlines()
for line in lines:
print("issue 1 1 use_skill inscription " + line)
And how do you use the second script
You have my attention.

You have my attention.
lordyoukai.DA
My wraith is cooler than your dragon.
My wraith is cooler than your dragon.