Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPHunter improvements #1953

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

IPHunter improvements #1953

wants to merge 2 commits into from

Conversation

Mercoory
Copy link
Contributor

  • More beeps when IP found
  • More often movement when IP found (Anti drop measure)
  • Overhead messages with countdown
  • Logs to D2BS console

Mercoory and others added 2 commits October 14, 2019 00:13
- More beeps when IP found
- More often movement when IP found (Anti drop measure)
- Overhead messages with countdown
- Logs to D2BS console
@jaenster improved the variable declaration.

Co-Authored-By: Jan Stoots <[email protected]>
@ChefKeeper
Copy link

This looks like a nice improvement, any reason it's not merged ?

@Tekmat
Copy link

Tekmat commented Mar 4, 2020

Work's great Thank you

Comment on lines +48 to +50
for (let i = (Config.IPHunter.GameLength * 60); i > 0; i -= 1) {
me.overhead(":( IP : [" + (ip) + "] NG: " + w + " sec");
delay(1000);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get an error on variable "w". Shouln't this be "i" instead?

Copy link

@kuberr kuberr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice improvements that I would like to see get merged! Just fix the one issue with "w" variable on line 49.

@kuberr
Copy link

kuberr commented Sep 4, 2020

I was thinking about adding one additional useful feature. Currently, the way I understand the script, is that it will wait for X seconds when the game is on the wrong IP. It will do this wait regardless of the actual time the game has already been open (for example, if your mf bot first did a few runs, then checks the IP it will still wait the full time). Putting the IPHunt script at some different place doesn't change this. I propose adding this snippet instead of the hardcoded wait amount:

let gameduration = (getTickCount() - me.gamestarttime) / 1000;
let minimumgameduration = Config.IPHunter.GameLength * 60;
		
if(gameduration < minimumgameduration){
	let remainingidletime = minimumgameduration - gameduration;
			
	for (let i = remainingidletime; i > 0; i -= 1){
		me.overhead(":( wrong IP: [" + (ip) + "]. NG: " + i + " sec");
		delay(1000);
	}
}	

*/

function IPHunter() {
var ip = Number(me.gameserverip.split(".")[3]);
let ip = Number(me.gameserverip.split(".")[3]);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Doesn't this work like below? And in case gameserverip for some reason is not there, shouldn't there be an if condition to check it like if (me.gameserverip)?

let ip = +me.gameserverip.split(".")[3];

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you tell me what the + (plus symbol) syntax does and why you think it is more appropriate than Number(...)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just syntactic sugar and can be ignored. But I believe that existence of gameserverip and it having 3 dots should be checked.

Town.move("waypoint");
Town.move("stash");
} catch (e) {
// ensure it doesnt leave game by failing to walk due to desyncing.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the error be logged to see what's the problem so it doesn't repeat?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants