using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Scion.Core;
using Scion.Library;
using Scion.Library.Underlying;
using Scion.Library.Advanced;
using Scion.Library.Antiban;
using Scion.Library.ReturnType;
using Scion.Library.RS.UI;
using Scion.Library.RS;
using System.Drawing;
namespace IronPowerMiner
{
public class Script : Superior
{
public static string ScriptAuthor = "Jaco";
TilePath bankWalk;
Inventory theInventory;
Bank eastBank;
PaintObject eula;
PaintObject loads;
int cLoads = 0;
public Script(Stub s)
{
baseStub = s;
eastBank = new Bank(this, BankLocation.VarrockEast);
bankWalk = new TilePath(this, new Tile[] { new Tile(3253, 3420), new Tile(3253, 3427), new Tile(3260, 3428), new Tile(3267, 3428), new Tile(3276, 3428), new Tile(3283, 3428), new Tile(3287, 3420), new Tile(3290, 3408), new Tile(3291, 3396), new Tile(3292, 3387), new Tile(3293, 3377), new Tile(3287, 3371), new Tile(3286, 3367) });
loads = new PaintObject("Loads: " + cLoads, Brushes.White, new Point(10, 60));
theInventory = new Inventory(this);
eula = new PaintObject("© 2009 Jaco - Educational Use Only", Brushes.Red, new Point(10, 40));
Graphics.AddObject(loads);
Graphics.AddObject(eula);
}
public void WalkBank()
{
bankWalk.WalkToStart(3);
Sleep(new SleepRandom(1000, 2000));
if (eastBank.Open())
eastBank.DepositAll("ron");
Sleep(new SleepRandom(1000, 2000));
eastBank.Close();
bankWalk.WalkToEnd(3);
}
public object ExecutionLoop()
{
if (DistanceToTile(new Tile(3253, 3420)) < 7)
bankWalk.WalkToEnd(3);
if (IsAnimating())
return new SleepRandom(200, 400);
else if (theInventory.IsFull())
{
Log.WriteLine("Full bank, depositing...");
WalkBank();
}
RSObject rso = new RSObject(this, Areas.CharacterCentre, FromRGB(72, 41, 30), "ine", Areas.WorldBounds, 5, 2);
int b = new System.Random().Next(1, 3);
if (b == 1)
rso.DoAction("ine", ChooseOption.Common);
else
rso.DoAction("", ChooseOption.Common);
return new SleepRandom(400, 500);
}
}
}