TFC 5
Originally Posted by box View Post
There's a /lockdown command that prohibits anyone from entering or leaving, in case you were unaware.

Additionally, I don't know if you just edited it or not, but nothing in that script loops, like you say. The only two hooks that are continuously called are draw2d and draw3d.

Oh I forgot about this command. Also it should loop on new_game I don't know why it doesn't, because for me it's fine. And what are you talking about? Where in my code it says about draw2d or draw3d hooks?
Last edited by dainiusb; Mar 19, 2014 at 09:02 PM.
Originally Posted by dainiusb View Post
Oh I forgot about this command. Also it should loop on new_game I don't know why it doesn't, because for me it's fine. And what are you talking about? Where in my code it says about draw2d or draw3d hooks?

The new_game hook is only called at the beginning of a new match.

I was talking about hooks in general, not in your code. The only hooks in Toribash that run continuously are draw2d and draw3d (and I guess enter_frame, if you press P).
[23:23:53] <AndChat|700625> Blue eyes ultimate dragon best card
[23:24:29] <AndChat|700625> You know the one with 3 heads
[23:24:39] <~Lightningkid> just like my dick



[11:35:40] <box> Hampa suck
[11:36:21] <hampa> not the first to tell me that today
Originally Posted by box View Post
The new_game hook is only called at the beginning of a new match.

I was talking about hooks in general, not in your code. The only hooks in Toribash that run continuously are draw2d and draw3d (and I guess enter_frame, if you press P).

Why would I want other hooks? I thought he wanted to do the betting before the match begins. I thought my code moves everyone to spec, lets them bet and then force enters them to the game? Is it missing a feature?
Sorry if I'm stupid ;)
Last edited by dainiusb; Mar 19, 2014 at 09:11 PM.
Originally Posted by dainiusb View Post
Why would I want other hooks? I thought he wanted to do the betting before the match begins. I thought my code moves everyone to spec, lets them bet and then force enters them to the game? Is it missing a feature?
Sorry if I'm stupid ;)

I'm not telling you to add these hooks. You said that the script is "looping at max speed", but that should not be true unless you add the draw2d or draw3d hooks, which are the only hooks that are called continuously. Even then, it shouldn't really be a problem unless you're doing very complicated processing in that hook function.

I also noticed that your script force-spectates everyone in the server to commence betting. You can't bet if there are no players in the match.
[23:23:53] <AndChat|700625> Blue eyes ultimate dragon best card
[23:24:29] <AndChat|700625> You know the one with 3 heads
[23:24:39] <~Lightningkid> just like my dick



[11:35:40] <box> Hampa suck
[11:36:21] <hampa> not the first to tell me that today
Originally Posted by box View Post
I'm not telling you to add these hooks. You said that the script is "looping at max speed", but that should not be true unless you add the draw2d or draw3d hooks, which are the only hooks that are called continuously. Even then, it shouldn't really be a problem unless you're doing very complicated processing in that hook function.

I also noticed that your script force-spectates everyone in the server to commence betting. You can't bet if there are no players in the match.

Oh thanks for noticing that. Also not the script is looping at max speed but the while in the idontcare function, my bad. That's the only way I could count seconds.

I'm lost. There's propably no way at the moment.
Last edited by dainiusb; Mar 19, 2014 at 09:52 PM.
To prevent 100% CPU replace the idontcare function by something like this:

local targetTime = 0

local function idontcare()
	if (num == 0) then
		num=1
		run_cmd("specall")
		run_cmd("enterfee 1000000")
		run_cmd("cancelbets")
		run_cmd("minbet 100")
		run_cmd("cp bet bet bet!")
		
		targetTime = tonumber(os.date("%I%M%S")) + 30 --time in seconds
		
		add_hook("draw2d", "countdown", function()
			if tonumber(os.date("%I%M%S")) >= targetTime then
				remove_hook("draw2d", "countdown")
				closeBetting()
			end
		end)
	end
end

local function closeBetting()
	run_cmd("minbet 1000000")
	run_cmd("cp betting closed!")
	people=get_bouts()
	run_cmd("enterfee 0")
	
	for i=0,#people do
		run_cmd("fenter "..people[i])
	end
end
Untested but should work.

Also indentation and speaking variable names don't hurt.
Signature temporarily out of order.
I think the only way for now (if running this from on host's side) is to tell fighters not space during betting, otherwise if one spaced, the script would move him to spec or kick for breaking rules..
That's what the pause command is for.
[23:23:53] <AndChat|700625> Blue eyes ultimate dragon best card
[23:24:29] <AndChat|700625> You know the one with 3 heads
[23:24:39] <~Lightningkid> just like my dick



[11:35:40] <box> Hampa suck
[11:36:21] <hampa> not the first to tell me that today
It does exactly as it says; it pauses the match from progressing.

It's a bit glitchy as it doesn't actually pause the game timer - I guess you'd have to set a high reaction time and pause the game after the users have moved their joints, but that requires trusting them not to space.

e: I'm goofy, you could just pause the game, set a high reaction time, and then unpause and allow joints to be moved after bets are placed. That'd probably work well.
Last edited by box; Mar 20, 2014 at 08:25 PM.
[23:23:53] <AndChat|700625> Blue eyes ultimate dragon best card
[23:24:29] <AndChat|700625> You know the one with 3 heads
[23:24:39] <~Lightningkid> just like my dick



[11:35:40] <box> Hampa suck
[11:36:21] <hampa> not the first to tell me that today