Register for your free account! | Forgot your password?

You last visited: Today at 16:03

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Autopot delay

Discussion on Autopot delay within the SRO Coding Corner forum part of the Silkroad Online category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Apr 2009
Posts: 120
Received Thanks: 17
Autopot delay

I've been using a timer of interval 1000 ms to use hp/mp pots when needed. Sometimes I get "Still have time to reuse the item". When I change the delay to a higher value like 1500-2000 ms it works fine.

My question is, how most of the bots/autopots use only 1000 ms delay without getting into issues like this ?

Thanks
supermando is offline  
Old 07/28/2013, 15:00   #2
 
LastThief*'s Avatar
 
elite*gold: 60
Join Date: Feb 2012
Posts: 3,942
Received Thanks: 6,474
try 1001ms
LastThief* is offline  
Old 07/29/2013, 02:13   #3
 
elite*gold: 0
Join Date: Apr 2009
Posts: 120
Received Thanks: 17
It's not exactly 1000ms, it ranges between 1015-1025 ms depending on execution time of the code before actually sending the packet (error checking and other stuff)
supermando is offline  
Old 08/02/2013, 20:05   #4
 
kevin_owner's Avatar
 
elite*gold: 0
Join Date: Jan 2010
Posts: 1,484
Received Thanks: 809
They are probably not using 1000ms between each potion but something higher like 1100 ms. You just have to find the sweet spot where you don't receive that error anymore.

Another way of doing it would be to still use 1000 ms and check if you get the error message in a response. If so, send the potion casting packet again till it works.
kevin_owner is offline  
Old 08/02/2013, 22:55   #5
 
lesderid's Avatar
 
elite*gold: 0
Join Date: Dec 2007
Posts: 2,400
Received Thanks: 1,517
Quote:
Originally Posted by kevin_owner View Post
They are probably not using 1000ms between each potion but something higher like 1100 ms. You just have to find the sweet spot where you don't receive that error anymore.

Another way of doing it would be to still use 1000 ms and check if you get the error message in a response. If so, send the potion casting packet again till it works.
Depending on your connection to the server, sending it, receiving the error and sending it again might take longer than simply finding the sweet spot (which is indeed probably around 1100 ms) and sending it once. Using potions as soon as possible can be quite crucial to keeping a character alive, so I would go for that solution.
lesderid is offline  
Thanks
1 User
Old 08/03/2013, 04:23   #6
 
elite*gold: 0
Join Date: Apr 2009
Posts: 120
Received Thanks: 17
Quote:
Originally Posted by lesderid View Post
Depending on your connection to the server, sending it, receiving the error and sending it again might take longer than simply finding the sweet spot (which is indeed probably around 1100 ms) and sending it once. Using potions as soon as possible can be quite crucial to keeping a character alive, so I would go for that solution.
For that reason I believe that timers are not reliable, so I tried doing this:
Code:
bool busy = false;
byte SlotHP; // its value is set by UseHP

private void HandleHPUpdate(Packet packet)
{
	if (CurrentPercentHP <= ConfiguredPercentHP && !busy)
	{
		busy = true; // prevent concurrent operations
		UseHP(); // use potion now
	}
}

private void HandleItemUsed(Packet packet)
{
	if (response != 1) // failed to use item
	{
		// busy is never set back to false
		// because I have no idea which slot
		// it was trying to use
		return;
	}
	if (ItemSlotUsed == SlotHP && busy)
	{
		if (CurrentPercentHP <= ConfiguredPercentHP) // hp is still low
		{
			UseHP(1000); //use potion after 1000ms
		}
		else // hp is higher than configured, stop using potions
		{
			busy = false;
			SlotHP = 255;
		}
	}
}
This works well, until it reaches a point where it tries to use a potion too fast (how is that even possible ?) the server then responds with "Still have time to reuse item" and obviously the flag "busy" is never set back to false, so the whole thing is stuck.
supermando is offline  
Old 11/12/2013, 18:51   #7
 
elite*gold: 0
Join Date: Nov 2013
Posts: 168
Received Thanks: 117
hmm seems interesting
Skullsoil is offline  
Reply


Similar Threads Similar Threads
Delay
01/14/2011 - Metin2 - 2 Replies
Hello,anyone know what is best delay for warrior?
SmartWHZ no delay is working i repeat No DELAY is Working!!!
09/17/2010 - Soldier Front Hacks, Bots, Cheats & Exploits - 61 Replies
dude i found out about the no delay that its working if u simply just turn it on ull get disconncted :( but theres a trick after turning it on turn it of right away there u are its working all ready but once u already turned it on and off u cant turn it off unless you log out :( its very usefull in horror mod pls press thnks



All times are GMT +1. The time now is 16:03.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.