| Author |
Message |
|
Mongoose
Commander
Joined: Mon Oct 29, 2001 3:00 am Posts: 1096 Location: Tucson, AZ
|
 Re: Publishing Weapon M tonight...
Let's keep everything on SF for now. I created a project on GitHub but I haven't done anything with it yet.
_________________ Suddenly you're Busted!
|
| Sat Jan 05, 2013 2:46 pm |
|
 |
|
mrdon
Chief Warrant Officer
Joined: Sat Nov 17, 2001 3:00 am Posts: 175
|
 Re: Publishing Weapon M tonight...
Mongoose wrote: Let's keep everything on SF for now. I created a project on GitHub but I haven't done anything with it yet. Well, I tried to create a bug but get this error message no matter what I choose in the dropdown: Value must be one of: map; scripts; emulation; terminal; parser; database; documentation; other (not [u'bug', u'terminal']) Seriously, SF is soo crap, and I'm not just saying that because my company runs Bitbucket  Could I help port the project, somewhere, anywere else?
|
| Sat Jan 05, 2013 3:50 pm |
|
 |
|
Tweety
Boo! inc.
Joined: Fri Jan 04, 2002 3:00 am Posts: 221 Location: Canada
|
 Re: Publishing Weapon M tonight...
ok. i'm trying to write my own PPT script. and i'm kind of avoiding using dialogs cause i don't know really how to work with them and i want things to work quickly lol i do'nt want to have to press and select and what not. just run and have it decide for me. some toggles though using settings i set in the game database notes.
I was wondering if you guys could expand a bit on your techniques for scripting using this event structure. I keep running into things where I need to set steps. i'm calling them steps. like anything can set off the command prompt event. a fed message. a / key. etc. so i find i need to control what is going on. i guess it is not unlike twx proxy where you had triggers firing on anything.
anyway. i keep rewriting my ppt code over and over. and starting over cause it didn't work how i quite liked. and then I rewrite to try to structure it in a easier way. or i see a api function that looked to work better. I'm not a programmer by trade and never have done it for work. just always on the side what i pick up and what i learn. i have some schooling but i never found the classes taught me much more than I knew already. it re-enforced some areas and gave me ideas, but never mind blowing.
what do you find works best for controlling the flow? do you write helper classes to assist, if so do you have an example?
i'm trying to make my ppt script see adj ports, and check if they have warps back. check status of the ports product. make decision on which port to pick out of the ones available in adjacent sector. of course it first made sure you were in a sector with a port to use. so i guess its kind of like world trade, but not.
so what i did was check the warps out, and pick out sectors that have a port. if they have a port, i check to see if they can cross trade. saw that api function lol. i first did it myself and then noticed it.. i then take that port and add it to one of 3 Lists. a org/equip, a fuel/equip and a fuel/org list. I didn't want the script to just pick the first port that matched a pair port criteria. I then check the ports in the arrays starting with org/equip for product amounts and select the port that has the most equip. lol it could get more in depth i'm sure to decide, but that is what i did. or tried to do. somewhere my logic went screwy so i'm doing another rewrite haha
but then i come to when to do things with the events. do you guys preassign a whole bunch of states that would happen within the script? and then do checks in the events for which state/step your on?
or am i just complicating things too much here?
|
| Sat Jan 05, 2013 4:28 pm |
|
 |
|
mrdon
Chief Warrant Officer
Joined: Sat Nov 17, 2001 3:00 am Posts: 175
|
 Re: Publishing Weapon M tonight...
Tweety wrote: but then i come to when to do things with the events. do you guys preassign a whole bunch of states that would happen within the script? and then do checks in the events for which state/step your on?
or am i just complicating things too much here? Did you see my ppt script? It is written in JavaScript, but the same basic principles apply. The on* methods are just a shorthand for registering for a ScriptEvent and handling it as it comes. I don't yet have a good way to detect the best pair, but that will simply be a matter of programming 
|
| Sat Jan 05, 2013 4:36 pm |
|
 |
|
Tweety
Boo! inc.
Joined: Fri Jan 04, 2002 3:00 am Posts: 221 Location: Canada
|
 Re: Publishing Weapon M tonight...
yeah i saw yours. i grabbed some information from it in regards to pulling some information from the database. thank you for that.
I'll get it i'm sure. Just have to find the best approach to my issues. and I don't tend to just settle. i keep trying to make it better LOL
|
| Sat Jan 05, 2013 4:38 pm |
|
 |
|
Tweety
Boo! inc.
Joined: Fri Jan 04, 2002 3:00 am Posts: 221 Location: Canada
|
 Re: Publishing Weapon M tonight...
i'm also finding that when i use the unloadSelf() to try to stop the script, it throws exceptions into the console and pops up a dialog. saying i unloaded from start script or something like that. or init or where ever i used that command. i wish it would just execute like when you unload it from the menu by selecting the checkmark. much quieter. i don't need to get bombarded by dialogs and errors. i just wanted to halt the script hehe
|
| Sat Jan 05, 2013 5:12 pm |
|
 |
|
mrdon
Chief Warrant Officer
Joined: Sat Nov 17, 2001 3:00 am Posts: 175
|
 Re: Publishing Weapon M tonight...
Tweety wrote: i'm also finding that when i use the unloadSelf() to try to stop the script, it throws exceptions into the console and pops up a dialog. saying i unloaded from start script or something like that. or init or where ever i used that command. i wish it would just execute like when you unload it from the menu by selecting the checkmark. much quieter. i don't need to get bombarded by dialogs and errors. i just wanted to halt the script hehe Yeah, I fixed that in my branch. I changed those to just debug messages because I do want to halt the script in init/startScript if it fails validation conditions. I also added a nice quit() function that lets me optionally display a message in a popup.
|
| Sat Jan 05, 2013 5:22 pm |
|
 |
|
Tweety
Boo! inc.
Joined: Fri Jan 04, 2002 3:00 am Posts: 221 Location: Canada
|
 Re: Publishing Weapon M tonight...
I get an error when i try to submit through source forge too. i have those options set stupid form. you just don't know what your doing! Mongoose wrote: The details of what caused the exception should be logged on the console. It would be extremely helpful if you redirected standard output to a file and sent me that info. For the next release I'm going to include a config file for logback that makes the logs go to a file automatically. how would i go about outputting data to a file for you mongoose? i'm guessing it is an option i can do with java when i load the program. i now made a script to load it. i tried to use jar bundler to build a mac app; however it no longer supports this new java that is out from what i can understand. It wasn't working for me when i tried. i was sad because i even pulled your weapon m image and made a icns file for it haha. right now all i get to look at is a stupid tea cup in my task bar. and when i have multiple tea cups it sucks too.
|
| Sat Jan 05, 2013 6:31 pm |
|
 |
|
mrdon
Chief Warrant Officer
Joined: Sat Nov 17, 2001 3:00 am Posts: 175
|
 Re: Publishing Weapon M tonight...
Tweety wrote: i now made a script to load it. i tried to use jar bundler to build a mac app; however it no longer supports this new java that is out from what i can understand. It wasn't working for me when i tried. FYI, I'm almost done getting http://code.google.com/p/getdown/ integrated, so you can run the app as a normal app and have it autoupdate. If I get time, I'll look into adding an installer as well.
|
| Sat Jan 05, 2013 6:40 pm |
|
 |
|
Tweety
Boo! inc.
Joined: Fri Jan 04, 2002 3:00 am Posts: 221 Location: Canada
|
 Re: Publishing Weapon M tonight...
cool. the auto update thing could be nice. I have another question for you guys since you both seem to be developing weapon m  I just have suggestions haha How are the scripts in the script menu loaded and displayed? by package if i don't override getMenuPath, it seems to display them randomly. I thought maybe it would go alphabetically. or by how my directory them. I then tried to do it by overriding and using the | separator. but it still showed in an order i wasn't expecting. but i didn't do it for all the scripts though. so maybe one takes precedence over the other. I haven't quite figured it out yet.
|
| Sat Jan 05, 2013 6:54 pm |
|
 |
|
mrdon
Chief Warrant Officer
Joined: Sat Nov 17, 2001 3:00 am Posts: 175
|
 Re: Publishing Weapon M tonight...
Tweety wrote: cool. the auto update thing could be nice. I have another question for you guys since you both seem to be developing weapon m  I just have suggestions haha How are the scripts in the script menu loaded and displayed? by package if i don't override getMenuPath, it seems to display them randomly. I thought maybe it would go alphabetically. or by how my directory them. I then tried to do it by overriding and using the | separator. but it still showed in an order i wasn't expecting. but i didn't do it for all the scripts though. so maybe one takes precedence over the other. I haven't quite figured it out yet. It is pretty random. It points a class finder at the directory then pulls them out in whatever order, probably determined by some internal hashmap. It should be pretty easy to order..what would you prefer? Alphabetical? getWeight()?
|
| Sat Jan 05, 2013 7:30 pm |
|
 |
|
Tweety
Boo! inc.
Joined: Fri Jan 04, 2002 3:00 am Posts: 221 Location: Canada
|
 Re: Publishing Weapon M tonight...
Alphabetical would make most sense. then whoever could organize their scripts easily enough by name/directory
|
| Sat Jan 05, 2013 7:38 pm |
|
 |
|
mrdon
Chief Warrant Officer
Joined: Sat Nov 17, 2001 3:00 am Posts: 175
|
 Re: Publishing Weapon M tonight...
Tweety wrote: Alphabetical would make most sense. then whoever could organize their scripts easily enough by name/directory I don't have any Java scripts to test with handy, but this should work: http://linode.twdata.org/weaponm/weapon ... dalone.jar
|
| Sat Jan 05, 2013 8:07 pm |
|
 |
|
Tweety
Boo! inc.
Joined: Fri Jan 04, 2002 3:00 am Posts: 221 Location: Canada
|
 Re: Publishing Weapon M tonight...
not quite. the loading the last database was neat.
was that sorting the names when you override menupath? I didn't over ride them so mine is loading from package names. I tried overriding menupath and set names. but they still seem random.
|
| Sat Jan 05, 2013 9:04 pm |
|
 |
|
Tweety
Boo! inc.
Joined: Fri Jan 04, 2002 3:00 am Posts: 221 Location: Canada
|
 Re: Publishing Weapon M tonight...
here is a screen cap. and also some stub java scripts. hehe they don't do much at all right now but they give you a feel of the menu system with them. https://docs.google.com/open?id=0BzF9tOZQT158WThUc1d1RTJkODQthe scripts are again just stubs. don't expect them to work hehe
Attachments:
tweety.zip [13.29 KiB]
Downloaded 480 times
|
| Sat Jan 05, 2013 9:14 pm |
|
 |
|