i got this error when compiling
hasla.cs(260,2) : error CS1513: } expected
my code is
using System;
using System.Windows.Forms;
using System.Threading;
using System.Threading.Tasks;
using System.Collections.Generic;
using System.Linq;
using ArcheBuddy.Bot.Classes;
namespace Hasla
{
public class Hasla : Core
{
const double _COMBAT_RANGE = 23;
public static string GetPluginAuthor()
{
return "Karls";
}
public static string GetPluginVersion()
{
return "1.0";
}
public static string GetPluginDescription()
{
return "HaslaGrinder: Assisting you for Hasla Weapon Grind";
}
List<Creature> team;
public Creature GetBestNearestMob(Zone zone)
{
try
{
foreach (var obj in getCreatures())
{
if (obj.type == BotTypes.Npc && isAttackable(obj) && (obj.firstHitter == null || obj.firstHitter == me || team.Contains(obj.firstHitter))
&& isAlive(obj) && (zone.ObjInZone(obj) || me.dist(obj) < _COMBAT_RANGE)
&& (hpp(obj) == 100 || obj.aggroTarget == me || team.Contains(obj.aggroTarget)))
{
return obj;
}
}
}
catch { }
return null;
}
public void UseSkillAndWait(string skillName, bool selfTarget = false)
{
if (getSkill(skillName) == null)
return;
while (me.isCasting || me.isGlobalCooldown)
Thread.Sleep(50);
if (skillCooldown(skillName) > 0)
return;
if (!UseSkill(skillName, true, selfTarget))
{
if (me.target != null && GetLastError() == LastError.NoLineOfSight)
{
if (dist(me.target) <= 5)
ComeTo(me.target, 2);
else if (dist(me.target) <= 10)
ComeTo(me.target, 3);
else if (dist(me.target) < 20)
ComeTo(me.target, 8);
else
ComeTo(me.target, 8);
}
}
while (me.isCasting || me.isGlobalCooldown)
Thread.Sleep(50);
}
public void PlayDead()
{
while (me.isCasting || me.isGlobalCooldown)
Thread.Sleep(50);
UseSkill("Play Dead", false, true);
Thread.Sleep(2000);
while (getAggroMobs().Count == 0 && (mpp() < 95 || hpp() < 95))
Thread.Sleep(100);
MoveForward(true);
Thread.Sleep(250);
MoveForward(false);
Log("Regen done");
}
public void LootThread()
{
try
{
BlockClientDice(true);
while (true)
{
foreach (var item in me.getDiceItems())
{
bool doRoll = false;
if (item.name.EndsWith("Coinpurse") || item.name.StartsWith("Unidentified") || item.id == 29207)
doRoll = true;
else if(item.id == 26056)
doRoll = GetGroupStatus("Conviction (Staff)");
else if (item.id == 26055)
doRoll = GetGroupStatus("Courage (Bow)");
else if (item.id == 35525)
doRoll = GetGroupStatus("Compassion (Heal)");
else if (item.id == 26057)
doRoll = GetGroupStatus("Fortitude (Shield)");
else if (item.id == 26053)
doRoll = GetGroupStatus("Honor (1H)");
else if (item.id == 26054)
doRoll = GetGroupStatus("Loyalty (2H)");
else if (item.id == 26058)
doRoll = GetGroupStatus("Sacrifice (Lute)");
item.Dice(doRoll);
if(doRoll)
Log("Rolling on : " + item.name);
else
Log("Passing on : " + item.name);
Thread.Sleep(500);
}
Thread.Sleep(1000);
}
}
finally
{
BlockClientDice(false);
}
}
public void RefreshTeam()
{
team = new List<Creature>();
foreach (var t in getPartyMembers())
team.Add(t.obj);
}
public void PluginRun()
{
DelAllGroupStatus();
new Task(() => { LootThread(); }).Start();
RoundZone zone = new RoundZone(me.X, me.Y, 40);
SetGroupStatus("Farm mobs ON", false);
SetGroupStatus("Courage (Bow)", false);
SetGroupStatus("Compassion (Heal)", false);
SetGroupStatus("Conviction (Staff)", false);
SetGroupStatus("Fortitude (Shield)", false);
SetGroupStatus("Honor (1H)", false);
SetGroupStatus("Loyalty (2H)", false);
SetGroupStatus("Sacrifice (Lute)", false);
Log("Starting Hasla Assistant");
Creature bestMob = null;
RefreshTeam();
while (true)
{
if (GetGroupStatus("Farm mobs ON") && isAlive())
{
if (GetGroupStatus("Farm mobs ON"))
{
if (getAggroMobs().Count == 0)
{
if (buffTime("Double Recurve (Rank 4)") == 0 && skillCooldown("Double Recurve") == 0)
UseSkillAndWait("Double Recurve", true);
if (((mpp() > 40 && hpp() > 75) || getAggroMobs().Count > 0))
{
bestMob = GetBestNearestMob(zone);
}
if (bestMob != null)
{
try
{
while (bestMob != null && isAlive(bestMob) && isExists(bestMob) && GetGroupStatus("Farm mobs ON") && isAlive())
{
if (bestMob.firstHitter != null && bestMob.firstHitter != me && !team.Contains(bestMob.firstHitter))
{
bestMob = null;
break;
}
if (bestMob.firstHitter == null && getAggroMobs().Count > 0 && bestMob != GetBestNearestMob(zone))
bestMob = GetBestNearestMob(zone);
if (me.target != bestMob)
SetTarget(bestMob);
if (angle(bestMob, me) > 45 && angle(bestMob, me) < 315)
TurnDirectly(bestMob);
var distToMob = me.dist(bestMob);
if (isAlive(bestMob))
{
if (distToMob > _COMBAT_RANGE)
{
ComeTo(me.target, _COMBAT_RANGE - 1);
}
else
{
if (skillCooldown("Endles Arrows") == 0 && hpp(me.target) == 100)
UseSkillAndWait("Endless Arrows");
else if (distToMob <= 20 && hpp(me.target) > 30 && skillCooldown("Drop Back") == 0
&& skillCooldown("Snare") <= 1000 && hpp() < 80)
{
UseSkillAndWait("Snare");
UseSkillAndWait("Drop Back");
}
else
{
UseSkillAndWait("Endless Arrows");
UseSkillAndWait("Endless Arrows");
UseSkillAndWait("Endless Arrows");
}
}
}
Thread.Sleep(10);
}
bestMob = null;
RefreshTeam();
}
catch { }
}
}
}
Thread.Sleep(10);
}
}
}
}
im sorry noob here.