Jump to content

  •  

tedexx

Member Since 20 Mar 2014
Offline Last Active Jun 02 2017 05:04 AM
-----

Posts I've Made

In Topic: Require a certain amount of reputation, posts and time registered to perform...

21 May 2017 - 11:39 PM

This will just encourage people making spam posts to increase their post count, and encourage creating other accounts to increase reputation. It makes everything cumbersome for everyone. You cannot and should not force people to contribute. You'll just end up driving away possible contributors to other projects (ie rAthena). Most people nowadays prefer to try first, then if they like it they come back and contribute. If people feel forced they just bail.

Agree on every single word.


In Topic: OnLogin Auto Command

21 May 2017 - 06:03 AM

-	script	autoCommand	FAKE_NPC,{
	end;
	OnPCLoginEvent:
		atcommand("@commands");
	end;
}

In Topic: run_script: Infinity loop !

21 May 2017 - 06:00 AM


*freeloop(<toggle>)

Toggling this to enabled (true) allows the script instance to bypass the
infinite loop protection, allowing your script to loop as much as it may 
need. Disabling (false) may warn you if an infinite loop is detected if your
script is looping too many times.

Please note, once again, that this isn't a solution to all problems, and by
disabling this protection your Hercules server may become laggy or
unresponsive if the script it is used in is performing lenghty loop
operations.

Example:
	freeloop(true); // enable script to loop freely

	//Be aware with what you do here.
	for (.@i = 0; .@i < .@bigloop; ++.@i) {
		dothis();
		// will sleep the script for 1ms when detect an infinity loop to 
		// let Hercules do what it need to do (socket, timer, process, 
		// etc.)
	}

	freeloop(false); // disable

	for (.@i = 0; .@i < .@bigloop; ++.@i) {
		dothis();
		// throw an infinity loop error
	} 

 

Add freeloop(true) to the beginning of your script.

 


In Topic: Best way to get floating value?

20 May 2017 - 05:30 PM

You could also emulate it in your scripts by adding some zeros to your numbers, ie

.@percent = rand(10000);

if (.@percent == 4273) {
    // 42.73%
}

 

Nope, something like calculate the % of EXP a quest will give for the current basejob, or anything slightly more complex. It will always exists a workaround, but with float would be so much simpler.


In Topic: Where can I find the commit for getvariableofpc()

15 May 2017 - 06:50 AM

https://github.com/H...4193759afb908db