Our Minecraft servers are offline but we will keep this forum online for any community communication. Site permissions for posting could change at a later date but will remain online.
Algorithm RegenHackDetector(namePlayer)
Detects if a player is regenerating health in an exploitive way
Pre:
namePlayer :: a reference to Player class
Post:
Nothing
Return:
False if player is not regenerating hearts in an exploitive manner
True if a player is regenerating hearts in an exploitive manner
while(namePlayer.online is true)
regenTime <- 5 //set to seconds
temp1 <- namePlayer.hearts
counter(regenTime)
temp2 <- namePlayer.hearts
//Gives the number of change
change <- temp2 - temp1
if(namePlayer.status.regeneration2 is false)
if(change > 4)
print "/kick namePlayer.name "Detected increased regeneration speed""
return true
end if
else if (namePlayer.status.regeneration2 is true)
if(change > 8)
print "/kick namePlayer.name "Detected increased regeneration speed""
return true
end if
//no need to do 6a and 6b if the player is offline
end while
return false
end
Actually this is far from true. You do not need to understand anything in Java to write Java but rather understand the concept of algorithms of computing code to understand Java. You could know the whole knowledge of Java but if you do not know how to write algorithms and concepts you basically do not understand Java at all. Computer coding in general is about understanding how to make algorithms and how to make small functions build together into a larger application. That is why if you know one language and the concepts behind it you basically know it all aside from language differences and libraries. My pseudocode is basically written so that a developer could translate this into an actual adt in Java and because of this I basically wrote an algorithm in Java without knowing much Java at all! (Although Java and C++ are very alike)To apply you'd definitely need to understand Java, since Minecraft is done in Java and therefore Minecraft related things are also done in Java.
Although you forgot about the part to check for the status of Regeneration II, I applaud you. If you could add that part of code in, I'll put the code in the first post!I basically translated your top-down design into basic pseudocode
NOTE: I have no idea what the classes specific details are but if you can understand this there is no need to worry about that.
Code:Algorithm RegenHackDetector(namePlayer) Detects if a player is regenerating health in an exploitive way Pre: namePlayer :: a reference to Player class Post: Nothing Return: False if player is not regenerating hearts in an exploitive manner True if a player is regenerating hearts in an exploitive manner while(namePlayer.online is true) regenTime <- 5 //set to seconds temp1 <- namePlayer.hearts counter(regenTime) temp2 <- namePlayer.hearts //Gives the number of change change <- temp2 - temp1 if(namePlayer.status.regeneration2 is false) if(change > 4) print "/kick namePlayer.name "Detected increased regeneration speed"" return true end if else if (namePlayer.status.regeneration2 is true) if(change > 8) print "/kick namePlayer.name "Detected increased regeneration speed"" return true end if //no need to do 6a and 6b if the player is offline end while return false end
Actually this is far from true. You do not need to understand anything in Java to write Java but rather understand the concept of algorithms of computing code to understand Java. You could know the whole knowledge of Java but if you do not know how to write algorithms and concepts you basically do not understand Java at all. Computer coding in general is about understanding how to make algorithms and how to make small functions build together into a larger application. That is why if you know one language and the concepts behind it you basically know it all aside from language differences and libraries. My pseudocode is basically written so that a developer could translate this into an actual adt in Java and because of this I basically wrote an algorithm in Java without knowing much Java at all! (Although Java and C++ are very alike)
This snippet of code from my last messageAlthough you forgot about the part to check for the status of Regeneration II, I applaud you. If you could add that part of code in, I'll put the code in the first post!
if(namePlayer.status.regeneration2 is false)
if(change > 4)
print "/kick namePlayer.name "Detected increased regeneration speed""
return true
end if
else if (namePlayer.status.regeneration2 is true)
if(change > 8)
print "/kick namePlayer.name "Detected increased regeneration speed""
return true
end if
Python is similar to other languages but scripting all together is expressed differently. You will use a ton of concepts from C++/any other programming languages into Python. I should note now that codes like HTML and CSS are a lot different since their concepts involve more about formatting although class concepts (styles in this case) are familiar. Just keep working at a language that interests you and then once you master it try to understand other languages just from your knowledge of python. You will learn other languages a lot quicker when you do this.Also, regarding what you said that you pretty much just need to understand the concept of Java to know how to code it, I'm teaching myself Python at the moment. I find it quite simple and have been making little scripts or tasks run by CMD. Would that be a good step towards Java? One thing I'm trying to do is to make a script that makes ASCII art from pictures. :3
Thanks so much for the tips. Sorry I didn't notice the code. Also, does 'hearts' represent 10 hearts, or 20 health points? Because my design referred to health points, not hearts.This snippet of code from my last message
checks if regeneration is true or false then checks if change > 4 or if change > 8 depending on those respective circumstances.Code:if(namePlayer.status.regeneration2 is false) if(change > 4) print "/kick namePlayer.name "Detected increased regeneration speed"" return true end if else if (namePlayer.status.regeneration2 is true) if(change > 8) print "/kick namePlayer.name "Detected increased regeneration speed"" return true end if
Python is similar to other languages but scripting all together is expressed differently. You will use a ton of concepts from C++/any other programming languages into Python. I should note now that codes like HTML and CSS are a lot different since their concepts involve more about formatting although class concepts (styles in this case) are familiar. Just keep working at a language that interests you and then once you master it try to understand other languages just from your knowledge of python. You will learn other languages a lot quicker when you do this.
It's based off your design so if you designed it for heart points then that is what the values reflect. I think in Minecraft the programming will always represent hearts as heart points whereas the GUI represents it as 10 hearts.Thanks so much for the tips. Sorry I didn't notice the code. Also, does 'hearts' represent 10 hearts, or 20 health points? Because my design referred to health points, not hearts.
Sweet. I'll add your pseudo-code to the first post.It's based off your design so if you designed it for heart points then that is what the values reflect. I think in Minecraft the programming will always represent hearts as heart points whereas the GUI represents it as 10 hearts.