new widget: QueueCopypasta

new widget: QueueCopypasta

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

dizekat
Posts: 438
Joined: 07 Dec 2007, 12:10

new widget: QueueCopypasta

Post by dizekat »

Allows you to copy-paste command queues in-game. Possibly that been already done.

http://dmytry.pandromeda.com/tmp/lua_fo ... ypasta.lua

Install: file -> save page as -> choose your ~/.spring/LuaUI/Widgets folder (on linux) or [dunno where that folder is on windows, probably program files / spring]
Usage:
press spacebar + alt + 0..9 to copy queue of selected units into buffer 0..9
press spacebar + 0..9 to paste queue from buffer 0..9 (appended to selected unit's queues. If you paste twice, it removes back).
If you defined meta key to be something other than spacebar, then press that instead of spacebar.
Works for multiple units too, abeit not very intuitively when you copy orders from multiple units. Compatible with that other widget for factories, whats its name
Example uses:
Copy build queue from constructors that risk dying, or before setting constructor to run away from threat.
Copy build queue, when some buildings were destroyed, paste queue to some builder to have it rebuild killed stuff.
Todo:
maybe track "child" units and factories produced by order sequence and save their order sequences recursively?

Mod compatibility:
Widget is supposed to be compatible with all or almost all mods.
Instructions for using this widget with mods that try to block spring from loading user widgets (if any such mods become available):
Unpack the mod, rename "lockluaui.txt" in the gamedata folder to exactly this name:
"lockluaui.txt.pwned_by_dizekat.b7pxw5lockluaui.txt" , pack the mod back.
You should now be able to play, even with people using original mod, and use any widgets.
(this rename should keep mod crc32 checksum unchanged, as the new name was carefully calculated to leave checksum intact. However i did not test that in any mod myself yet. If you show as desync after this rename, contact me.)
Warning: Do it at your own risk. This enables all user widgets.
It might cause problems with mod-incompatible widgets, and it *will* likely cause emo reaction from the person that added lockluaui.txt

Updates:
1.1 Saves copied queues to config now.
Last edited by dizekat on 12 Sep 2008, 18:23, edited 4 times in total.
User avatar
TheFatController
Balanced Annihilation Developer
Posts: 1177
Joined: 10 Dec 2006, 18:46

Re: new widget: QueueCopypasta

Post by TheFatController »

dizekat wrote:Instructions for using this widget with mods that try to block spring from loading user widgets (if any such mods become available):
:mrgreen:
User avatar
Hoi
Posts: 2917
Joined: 13 May 2008, 16:51

Re: new widget: QueueCopypasta

Post by Hoi »

what could be done with a widget? the worst 'cheating widget that officially is not cheating' is the ghostradar, and that is actually implented in spring with the radar ai.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: new widget: QueueCopypasta

Post by KDR_11k »

You can probably just check if lockluaui.txt exists in a gadget and cause a crash otherwise...
dizekat
Posts: 438
Joined: 07 Dec 2007, 12:10

Re: new widget: QueueCopypasta

Post by dizekat »

Hoi, it has nothing whatsoever to do with cheating prevention. Its that modmaker wants some quite unreasonable control over what happens on the user's computer and what user can do with his computer and what he cant. Control which modmaker can't have, neither technically nor legally. Just like you can't have a star taken from the sky and given you in a box. Being spoiled kids, they get tantrums over this.
(There only exists legal control of author over copying and redistribution, and even that is severely impacted by GPL).
Its same psychological reason why, on much bigger scale than this, DRMs are so popular despite being expensive and not working. Perhaps people have built in instinct to want control over what other people do, whenever they could and couldn't.

KDR_11k: damn ya, you spoiled it :( . I'm sure the kind of people whom would put lockluaui.txt to "have control" would never figure it out themselves.
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: new widget: QueueCopypasta

Post by imbaczek »

anybody wants to make unitsync return sha-512 instead of crc32? 8)
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: new widget: QueueCopypasta

Post by lurker »

Dizekat, I don't see why you call this DRM. Every spring game I've seen thus far has had its source code right out in the open and doesn't mind you modifying your copy for your own use. The issue here is fairness in a multiplayer game. It's perfectly fine for two people with FunGame-nolockluauiversion to play against each other, but when one player is flat-out lying about what package they have, and use it to give themselves an advantage, it's not right. Sure, it's irritating that some games will block *all* external widgets, but there is no way for the game itself to know what is abusive and what isn't.

Everyone here worried about cheating, need I remind you that to have a maphack you only have to change one character in the source code? Cheaters will always cheat.
dizekat
Posts: 438
Joined: 07 Dec 2007, 12:10

Re: new widget: QueueCopypasta

Post by dizekat »

lurker wrote:Dizekat, I don't see why you call this DRM. Every spring game I've seen thus far has had its source code right out in the open and doesn't mind you modifying your copy for your own use. The issue here is fairness in a multiplayer game. It's perfectly fine for two people with FunGame-nolockluauiversion to play against each other, but when one player is flat-out lying about what package they have, and use it to give themselves an advantage, it's not right. Sure, it's irritating that some games will block *all* external widgets, but there is no way for the game itself to know what is abusive and what isn't.
See, its about some control ("Allowing unmitigated use of user lua takes control away from the gamemaker. "). Not a *slightest* bit about cheating prevention or fairness.
lockluaui.txt is hundred percent unsuitable for cheating prevention, it AFAIK doesn't even block helper AIs (which, need i tell you, can do much more powerful things than widgets ever could).
Everyone here worried about cheating, need I remind you that to have a maphack you only have to change one character in the source code? Cheaters will always cheat.
precisely. Well dunno about 1 character, but i suppose it is, ! operator at a right place.
edit: same goes for enabling external lua widgets. Even easier in fact because in commit history you see how it was added and where.
Last edited by dizekat on 12 Sep 2008, 22:56, edited 1 time in total.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Re: new widget: QueueCopypasta

Post by FLOZi »

Game makers wanting to control what widgets can interact with THEIR game is hardly excessive control over the players computer. :roll:


Also, FOAD, Forb. /me pats his excellent state education
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: new widget: QueueCopypasta

Post by lurker »

Well, nothing spring can do can actually prevent cheating, no matter what.
dizekat wrote:precisely. Well dunno about 1 character, but i suppose it is, ! operator.
What I saw was changing a & to a |. Didn't bother compiling it, but it should work.
dizekat wrote:same goes for enabling external lua widgets. Even easier in fact because in commit history you see how it was added and where.
Nah, you don't need to be able to compile to do that; just use a hex editor and change it to lockluaui.nop
dizekat
Posts: 438
Joined: 07 Dec 2007, 12:10

Re: new widget: QueueCopypasta

Post by dizekat »

FLOZi wrote:Game makers wanting to control what widgets can interact with THEIR game
on YOUR hardware
[also, merely a mod, not game.]
is hardly excessive control over the players computer. :roll:
I never said it was excessive, just that it was impossible.

BTW, look whats the problem. If as a widget maker i have at least a bit of effect on in which way mods can affect my widget and in which them cant, thats somehow highly wrong. Even despite whole issue being totally unrelated to cheating.
Can anyone spot utter hypocrisy in all that reaction from modmakers?

can moderators btw somehow move all the utter offtopic crap and forb's tantrum out of this thread somewhere else? (including my replies) edit: but not to /dev/null
Last edited by dizekat on 12 Sep 2008, 23:17, edited 2 times in total.
dizekat
Posts: 438
Joined: 07 Dec 2007, 12:10

Re: new widget: QueueCopypasta

Post by dizekat »

lurker wrote:
dizekat wrote:same goes for enabling external lua widgets. Even easier in fact because in commit history you see how it was added and where.
Nah, you don't need to be able to compile to do that; just use a hex editor and change it to lockluaui.nop
lol, i didnt even think about fact that anyone could just use using hex editor, coz of game being open source.
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: new widget: QueueCopypasta

Post by lurker »

You have plenty of control over what mods you want to run with, but you should make a mutator with lockluaui removed. Mod makers don't want to control your computer, they just want you to be honest when in a multiplayer match.
User avatar
det
Moderator
Posts: 737
Joined: 26 Nov 2005, 11:22

Re: new widget: QueueCopypasta

Post by det »

imbaczek wrote:anybody wants to make unitsync return sha-512 instead of crc32? 8)
Too slow, unfortunately. CRC32 is nearly instant because it is read from zip/7z archive header. SHA-1 wouldnt even be a solution to this, it is a 1 byte change to the exe or source code.

My take on this is that LockLuaUI.txt is just a gentlemen's agreement. All players agree not to use third party widgets. Of course, there is nothing stopping you from doing so. If you want to play the game with third party widgets, then just release a mutator that disables the lock and play that. Then it is clear what the agreements are.
dizekat
Posts: 438
Joined: 07 Dec 2007, 12:10

Re: new widget: QueueCopypasta

Post by dizekat »

det wrote: My take on this is that LockLuaUI.txt is just a gentlemen's agreement. All players agree not to use third party widgets. Of course, there is nothing stopping you from doing so. If you want to play the game with third party widgets, then just release a mutator that disables the lock and play that. Then it is clear what the agreements are.
My take on this is that LockLuaUI.txt was made to let mod override certain spring's built in widgets from mod, allowing greater flexibility. For gentlemen agreement its neither required nor sufficient (doesnt block helper AIs)
I don't care enough to release a mutator. Just an universal walkthrough for fixing compatibility issues.
dizekat
Posts: 438
Joined: 07 Dec 2007, 12:10

Re: new widget: QueueCopypasta

Post by dizekat »

lurker wrote:You have plenty of control over what mods you want to run with, but you should make a mutator with lockluaui removed. Mod makers don't want to control your computer, they just want you to be honest when in a multiplayer match.
again, it has precisely nothing to do with cheating prevention, as you yourself full realize. Nor do mod makers care about cheating, evidently. Wheres requests to let mod disable helper AIs?
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: new widget: QueueCopypasta

Post by lurker »

lockluaui.txt is there to block user widgets. No, not to prevent, but it is not simply there to override user widgets with mod versions. It is a barrier that to cross is a form of cheating (for many widgets you could use), even if it's relatively easy.
dizekat wrote:Wheres requests to let mod disable helper AIs?
People don't use those that much / no one really thought of it, I guess.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Re: new widget: QueueCopypasta

Post by FLOZi »

dizekat wrote:
FLOZi wrote:Game makers wanting to control what widgets can interact with THEIR game
on YOUR hardware
[also, merely a mod, not game.]
is hardly excessive control over the players computer. :roll:
I never said it was excessive, just that it was impossible.

BTW, look whats the problem. If as a widget maker i have at least a bit of effect on in which way mods can affect my widget and in which them cant, thats somehow highly wrong. Even despite whole issue being totally unrelated to cheating.
Can anyone spot utter hypocrisy in all that reaction from modmakers?

can moderators btw somehow move all the utter offtopic crap and forb's tantrum out of this thread somewhere else? (including my replies) edit: but not to /dev/null
No, GAME.


I'm off to write a gadget that will blow up all units belonging to players called 'dizekat'.
User avatar
Nemo
Spring 1944 Developer
Posts: 1376
Joined: 30 Jan 2005, 19:44

Re: new widget: QueueCopypasta

Post by Nemo »

FLOZi beat me to it <_<
dizekat
Posts: 438
Joined: 07 Dec 2007, 12:10

Re: new widget: QueueCopypasta

Post by dizekat »

FLOZi: i'm fine with that.
/me uses smurf
lurker wrote:
dizekat wrote:Wheres requests to let mod disable helper AIs?
People don't use those that much / no one really thought of it, I guess.
Say, you'd be misinformed into believing effective cheating prevention is possible in OSS game, and you'd *care* to prevent cheating. You'd think about it if you care, no? AIs was first thing that Hoi mentioned.
Its just desire for some control here, no matter how tiny and worthless. Same as with real world DRMs which are also hundred percent useless but very popular. Theres just no fully rational explanation why people blow millions on DRM schemes or why forb is so pissed off.
Post Reply

Return to “Lua Scripts”