| Author |
Message |
|
mrdon
Chief Warrant Officer
Joined: Sat Nov 17, 2001 3:00 am Posts: 175
|
 Re: Publishing Weapon M tonight...
Is there any way I could convince you to switch to git for your projects? I'm creating a maven build for them, but subversion makes it such a pain to maintain patches and forks. I could maintain one on bitbucket or github, but then I'll lose all the history when I periodically update it with your changes. With git, changes merge together nicely (not to mention git is just way better in every other respect) 
|
| Tue Jan 01, 2013 2:10 pm |
|
 |
|
Mongoose
Commander
Joined: Mon Oct 29, 2001 3:00 am Posts: 1096 Location: Tucson, AZ
|
 Re: Publishing Weapon M tonight...
Sure, I'll put it on github. I do like the way pull requests work vs. having to give every contributor push access.
_________________ Suddenly you're Busted!
|
| Tue Jan 01, 2013 2:15 pm |
|
 |
|
mrdon
Chief Warrant Officer
Joined: Sat Nov 17, 2001 3:00 am Posts: 175
|
 Re: Publishing Weapon M tonight...
Awesome, that will make things much, much easier 
|
| Tue Jan 01, 2013 2:56 pm |
|
 |
|
mrdon
Chief Warrant Officer
Joined: Sat Nov 17, 2001 3:00 am Posts: 175
|
 Re: Publishing Weapon M tonight...
Can't seem to be able to create an issue in your project, so attached are the pom files for jtx, jplex, automaton-lexer, and weapon-m. To make it easier, I used a Maven repo of mine to deploy snapshots of all the deps, a timestamp beta release of Prefuse, and 3.0 of pf-joi so you should be able to use the pom for weapon-m and have it build straightaway. If you could do proper releases of the deps, that'd be quite helpful  Attachment:
File comment: pom files for jtx, jplex, automaton-lexer, and weapon-m
maven-build.zip [4.11 KiB]
Downloaded 402 times
|
| Tue Jan 01, 2013 7:46 pm |
|
 |
|
Micro
Ambassador
Joined: Wed Apr 20, 2011 1:19 pm Posts: 2559 Location: Oklahoma City, OK 73170 US
|
 Re: Publishing Weapon M tonight...
Weapon M doesn't seem to like the "Galactic Announcements" I use on my server.
After the TradeWars opening ANSI displays and I hit enter at the "[Pause]" prompt it says "<< Disconnected >>", and I get an error pop-up "java.lang.NullPointerException".
I tried a couple other servers and it worked fine, so I temporarily deleted the announcement on my server, and it worked fine on my server too.
_________________ Regards, Micro Website: http://www.microblaster.net TWGS2.20b/TW3.34: telnet://twgs.microblaster.net:2002
ICQ is Dead Jim! Join us on Discord: https://discord.gg/zvEbArscMN
|
| Tue Jan 01, 2013 7:56 pm |
|
 |
|
Mongoose
Commander
Joined: Mon Oct 29, 2001 3:00 am Posts: 1096 Location: Tucson, AZ
|
 Re: Publishing Weapon M tonight...
Micro: That's happening because your announcement contains something that matches the pattern of a CIM sector report. It doesn't look like it should, so I probably need to tighten up the regular expression.
_________________ Suddenly you're Busted!
|
| Tue Jan 01, 2013 11:42 pm |
|
 |
|
Micro
Ambassador
Joined: Wed Apr 20, 2011 1:19 pm Posts: 2559 Location: Oklahoma City, OK 73170 US
|
 Re: Publishing Weapon M tonight...
I had a thought on that. I'm amusing that regular expressions (RE) should be kept short for efficiency... right? So when you get a RE hit, then do a longer string comparison to verify the hit, and also verify ANSI sequences in the string so you don't get spoofed on Comms.
_________________ Regards, Micro Website: http://www.microblaster.net TWGS2.20b/TW3.34: telnet://twgs.microblaster.net:2002
ICQ is Dead Jim! Join us on Discord: https://discord.gg/zvEbArscMN
|
| Wed Jan 02, 2013 12:22 am |
|
 |
|
Tweety
Boo! inc.
Joined: Fri Jan 04, 2002 3:00 am Posts: 221 Location: Canada
|
 Re: Publishing Weapon M tonight...
Mongoose: I've looked at the ticket section on source forge and haven't found a way to create one yet. I can search for them and view them. but can't create them. i even tried signing up for a forge account. If i can post bugs in ticket form, i'll gladly help you by doing so. just need to see where I an actually do that.
I also don't see any extra input when I turn on the debug options for ANSI , Scripts or Lexer. where is it supposed to dump this information for view?
I have been testing it on a version 2 server at On the Road again. it is a custom edit, the ice practice game.
|
| Wed Jan 02, 2013 1:34 am |
|
 |
|
Tweety
Boo! inc.
Joined: Fri Jan 04, 2002 3:00 am Posts: 221 Location: Canada
|
 Re: Publishing Weapon M tonight...
The moving application screen bug:
More information:
I moved weapon m around my main screen a few times and the display stayed fine this time. But once i moved it off my screen onto my other monitor, it didn't redraw the display text. maybe this is part of the issue. so i tested it again.
I moved the screen half way off my main monitor and it still worked fine. I moved it all around on my main screen and it worked fine. but once i took the main screen and moved it over to my other monitor. i have dual monitors. i guess i should have mentioned that. the display goes blank and requires a reload of the application.
|
| Wed Jan 02, 2013 1:59 am |
|
 |
|
mrdon
Chief Warrant Officer
Joined: Sat Nov 17, 2001 3:00 am Posts: 175
|
 JavaScript support
Not a fan of Java but want to hack Weapon M? Try JavaScript! I added JavaScript support to Weapon M as an alternative language for scripting. Here is what a simple script (scripts/test.js) looks like : Code: function startScript(script) { print("starting script in game of " + script.sectors() + " sectors"); }
function onCommandPrompt(time, sector) { print("command prompt: '" + time + "' at sector '" + sector + "' has warp to 1: " + sector.hasWarpTo(1)); }
Notice you can subscribe to events just by declaring a function, and you can interact with the parameters in a very friendly way. Patch attached here: Now begins the fun of porting twxproxy scripts... 
|
| Wed Jan 02, 2013 2:12 am |
|
 |
|
Mongoose
Commander
Joined: Mon Oct 29, 2001 3:00 am Posts: 1096 Location: Tucson, AZ
|
 Re: Publishing Weapon M tonight...
Micro wrote: I had a thought on that. I'm amusing that regular expressions (RE) should be kept short for efficiency... right? So when you get a RE hit, then do a longer string comparison to verify the hit, and also verify ANSI sequences in the string so you don't get spoofed on Comms. It's probably more efficient to use a long RE that won't match anything unintended. I've included ANSI sequences in almost all REs because stripping them would open up a whole new can of spoofing worms. Comms aren't the problem, because they have a consistent preceding context; you can always identify comms as comms. The real problem with ANSI off is messages like "<trader> warps into the sector", "<trader> is hailing you!", etc., because they appear as the first thing on a new line. Trader names have few restrictions and can be long enough to spoof nearly any message or prompt. There's even one prompt they can spoof with ANSI on; fortunately, it has consistent preceding context that can't be spoofed.
_________________ Suddenly you're Busted!
|
| Wed Jan 02, 2013 5:29 am |
|
 |
|
Mongoose
Commander
Joined: Mon Oct 29, 2001 3:00 am Posts: 1096 Location: Tucson, AZ
|
 Re: Publishing Weapon M tonight...
Tweety: I have a good idea where to look for the bug that's making your terminal turn white. The VGASoftFont class in JTX blits glyphs from a potentially hardware-accelerated VolatileImage. The VolatileImage would need to be refreshed if the display device changes, but it sounds like that isn't happening at the right time.
_________________ Suddenly you're Busted!
|
| Wed Jan 02, 2013 5:36 am |
|
 |
|
mrdon
Chief Warrant Officer
Joined: Sat Nov 17, 2001 3:00 am Posts: 175
|
 Re: Publishing Weapon M tonight...
Inspiration struck last night with an idea how to make these event-driven scripts easy to write and read. I modified my JavaScript script support to include continuation functionality. This means you can now write a script like this: Code: function startScript(script) { print("starting game of " + script.sectors() + " sectors");
var [time, sector] = waitForCommandPrompt(); print("You are in sector " + sector); }
Behind the scenes, the script is "pausing" on the waitFor commands, allowing you to write simple linear scripts that are familar and intuitive. This technique can still be combined with global event listeners so this script will work as expected: Code: function startScript(script) { print("starting game of " + script.sectors() + " sectors");
var [time, sector] = waitForCommandPrompt(); print("You are in sector " + sector); }
function onChatMessage(type, sender, message) { if (type.name() == "FED_COMM") { print("message from fedcomm: [" + sender.getName() + "] " + message); } }
Instead of continuing to attach patches, I'll just link to my repo: https://bitbucket.org/mrdon/weapon-m. A pre-built binary (executable jar) can be found here: http://linode.twdata.org/weaponm/weapon ... dalone.jar
|
| Wed Jan 02, 2013 10:58 am |
|
 |
|
Tweety
Boo! inc.
Joined: Fri Jan 04, 2002 3:00 am Posts: 221 Location: Canada
|
 Re: Publishing Weapon M tonight...
Game Parsing
I was looking through the api and i didn't see anything to do with combat. so when you attack, lose fighters, combat scanner, etc
maybe i'm just missing something
|
| Wed Jan 02, 2013 7:46 pm |
|
 |
|
Tweety
Boo! inc.
Joined: Fri Jan 04, 2002 3:00 am Posts: 221 Location: Canada
|
 Re: Publishing Weapon M tonight...
I also can't seem to run a second copy simultaneously. i'll keep trying. I try to load another and it just brings me to the program i already have open.
|
| Wed Jan 02, 2013 7:55 pm |
|
 |
|