silverdraco
Member
- Joined
- Jan 29, 2015
- Messages
- 50
- Reaction score
- 0
From the requests forum:
EDIT: Forgot a }
EDIT: Forgot a }
Code:
using System;
using System.Drawing;
using System.Windows.Forms;
using System.Threading;
using System.Collections.Generic;
using System.Linq;
using ArcheBuddy.Bot.Classes;
namespace DefaultNameSpace{
public class DefaultClass : Core
{
public static string GetPluginAuthor()
{
return "Silver";
}
public static string GetPluginVersion()
{
return "0.9b";
}
public static string GetPluginDescription()
{
return "Auto drop backs on a preset height (default 18 meters) after falling for a certain amount of time (default 10 meters)";
}
// Edit this to what you want the script to drop back at.
int dropBackHeight = 18;
public void PluginRun(){
ClearLogs();
double currentZ = me.Z;
double lastZ = currentZ;
double currentFall = 0;
double startFall = 0;
bool falling = false;
while(true){
lastZ = currentZ;
currentZ = me.Z;
if(currentZ < lastZ && calculateHeight() > 10){
falling = true;
startFall = lastZ;
}else{
falling = false;
}
int cycle = 0;
while(falling){
if(cycle > 0){
lastZ = currentZ;
Thread.Sleep(120);
currentZ = me.Z;
}
if(currentZ < lastZ){
currentFall = startFall - currentZ;
if(currentFall > 10){
if(calculateHeight() < dropBackHeight){
if(skillCooldown(12049) == 0){
Log("Dropping back!");
UseSkill(12049);
}else{
Log("Couldn't drop back because of Cooldown! (" + skillCooldown(12049) + " ticks left)");
}
}
}
}else{
falling = false;
}
cycle++;
}
}
}
private double calculateHeight(){
return (me.Z - getZFromHeightMap(me.X, me.Y));
}
public void PluginStop()
{
}
}
}
Last edited: