xxlegitxx
2007-08-11 00:09:52
These are common redundancies I find in scripts that can be shorted with a beneficial effect on your script:
Also, sometimes you need to hover your mouse over something before clicking. So do MMouse, then take this procedure from Mouse:
And I need you guys to post anything else that is superfluous.
to:
if ( not(LoggedIn)) then LoginPlayer;LoginPlayer calls in LoggedIn anyway.
LoginPlayer;
to:
if (WearingItem(i)) then TakeOffItem(i);Redundant.
TakeOffItem(i);
to:
Mouse(x, y, randx, randy);
Wait(100 + Random(100));Mouse has a small random wait after the procedure, making it unnecessary to include another.
Mouse(x, y, randx, randy, leftclick);
to:
GameTab(1);
SetUpAutoCast(AutoSpell, Defensive); OR SetFightMode(oFightMode); OR GetCombatLevel;
SetUpAutoCast(AutoSpell, Defensive); OR SetFightMode(oFightMode); OR GetCombatLevel;
to:
GameTab(2);
GetHP; OR GetSkillAmount(skill); OR GetSkillLevel(skill); OR NextLevelAt(skill); OR GetXP(skill); OR XpTilNextLevel(skill, round); OR HpPercent; OR GetHp; OR GetAllLevels; OR RealEatIfNeeded;
GetHP; OR GetSkillAmount(skill); OR GetSkillLevel(skill); OR NextLevelAt(skill); OR GetXP(skill); OR XpTilNextLevel(skill, round); OR HpPercent; OR GetHp; OR GetAllLevels; OR RealEatIfNeeded;
to:
GameTab(4);
FindItemsArray(color, tol, Text, num); OR WeHaveLogs(WhereX, WhereY); OR FindFishingEquipment(FishingEquipmentColor, FishingEquipmentName); OR FindPickHeadColor; OR FindPick; OR FindInvArrows(arrowx, arrowy); OR EquipArrows; OR ClickPouch(Pouch, Option, tol); OR ClickTalisman; OR FindAxeHeadColor; OR AttachHead; OR FindHead;Note: FindTalismanInInventory needs to be updated to include (GameTab(4)) before checking for talismans.
FindItemsArray(color, tol, Text, num); OR WeHaveLogs(WhereX, WhereY); OR FindFishingEquipment(FishingEquipmentColor, FishingEquipmentName); OR FindPickHeadColor; OR FindPick; OR FindInvArrows(arrowx, arrowy); OR EquipArrows; OR ClickPouch(Pouch, Option, tol); OR ClickTalisman; OR FindAxeHeadColor; OR AttachHead; OR FindHead;
to:
GameTab(5);
WearingItem(i); OR TakeOff(i); OR CheckEquipItems(number); OR ArrowAmount; OR GetArrowColor; OR AttachHead;
WearingItem(i); OR TakeOff(i); OR CheckEquipItems(number); OR ArrowAmount; OR GetArrowColor; OR AttachHead;
to:
GameTab(6);
PrayerClick(Prayer); OR ClickPrayer(slot, Activated); OR AllPrayersOff;Note: ExistsPrayer needs to be updated to include "GameTab(6)" before checking the prayer slots.
PrayerClick(Prayer); OR ClickPrayer(slot, Activated); OR AllPrayersOff;
GameTab(7);
Cast(TheSpell); OR CastSpell(SpellNumber); OR CastOn(Spell, Monster, MonsterColor, Tolerance); OR GetLumbridgeMins;
to:
Cast(TheSpell); OR CastSpell(SpellNumber); OR CastOn(Spell, Monster, MonsterColor, Tolerance); OR GetLumbridgeMins;
to:
GameTab(8);
CurrentWorld;
CurrentWorld;
to:
GameTab(11);
SetRun;
SetRun;
to:
GameTab(12);
DoEmote(EmoteNumber); OR RandomEmote;These procedures and functions already select the game tab, rendering it useless to select the gametab beforehand.
DoEmote(EmoteNumber); OR RandomEmote;
Also, sometimes you need to hover your mouse over something before clicking. So do MMouse, then take this procedure from Mouse:
Wait(60 + Random(30));
GetMousePos(b, c);
HoldMouse(b + 1, c, left);
repeat
Wait(20 + Random(30));
a := a + 1;
until (a > 4);
GetMousePos(b, c);
ReleaseMouse(b, c, left);
Unless there is some better way?And I need you guys to post anything else that is superfluous.