Itsboxxy! (the funny circular startbox script)

Itsboxxy! (the funny circular startbox script)

Hearken back to the days of yore and enjoy the first major Spring module!

Moderators: Moderators, Content Developer

Post Reply
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Itsboxxy! (the funny circular startbox script)

Post by knorke »

This is the best startbox editor so far.

http://www.lua.org/cgi-bin/demo is easy way to run Lua without installing anything.
1) :o Copy the script into textfield
2) :roll: edit script as needed
3) 8) click [Run] button.
4) :regret: Copy output into chat.
5) :shock: Perfect circular start boxes!

Code: Select all

--its boxxy! the circular startbox maker!
--for use with http://www.lua.org/cgi-bin/demo
 
local n = 7 --how many boxes
local r = 75 --radius of circle
local a = 10 --size of boxes
 
function box (x,y,a)
	x=math.floor (x)
	y=math.floor (y)
	io.write("!addbox " .. x-a .. " " ..y-a .. " "..x+a.." " ..y+a..    "\n")
end
 
for i = 0.001,2*math.pi,(2*math.pi/n)  do
  box (100+math.sin(i)*r ,100+math.cos(i)*r,a)  
end
Attachments
bla.png
bla.png (31.98 KiB) Viewed 1842 times
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Itsboxxy! (the funny circular startbox script)

Post by Jools »

Nice!

Note that spads uses the coordinates x,y ∈ [0,200] and springie uses x,y ∈ [0,100]. In addition, spads uses the format addbox x1, y1, x2, y2 <boxnum>, whereas springie uses addbox x, y, Δx, Δy
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Itsboxxy! (the funny circular startbox script)

Post by Jools »

This could probably be made into a spads plugin. If someone can translate lua => perl.
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: Itsboxxy! (the funny circular startbox script)

Post by CarRepairer »

It's boxxy the funny circular startbox generator inside the boxxy lobby client.

Image

^ This has been boxxy the thread post.

Why do you name everything boxxy? It's like the Q Continuum.
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Itsboxxy! (the funny circular startbox script)

Post by Jools »

That's very nice. But unfortunately weblobby doesn't work on my system, hope we can get similar functionality in a spads plugin, or the other lobbies.

http://imgur.com/NC39R8l
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Itsboxxy! (the funny circular startbox script)

Post by Jools »

Now there is also a spads plugin, it works just like the code above. The syntax is:

!addboxpolar <number of boxes> <radius> <boxsize>

Where:
number > 0
radius ∈ ]0, 100 - boxsize/2]
boxsize ∈ ]0, 100]

Image

If someone wants to add the plugin to spads, it is attached to the spads thread. It's version 0.2 so some things are stupoid. For example, it clears only the 50 first boxes, it's hardcoded because I could not figure out how to access the number of teams variable in spads. Also, it does not check if startpostype = 2. So use it wisely.

It's already added to semprini.

Edit: for some reason it only works up to number of boxes = 15. After that consecutive boxes to be added yield an error, which can be seen in #local, like this:

Code: Select all

[16:52:10] Ambiguous command : ADDSTARTRECT 16 59 183 79 163
I see nothing wrong with that command (parameters are teamNb left top right bottom)

Edit2: version 0.2 fixes the fact that teamnumbers started on 1 and not 0.
Post Reply

Return to “XTA”