nickrules
2010-06-07 21:09:26
Just wanted to know if it would be of use at all, or if not, should I just abandon this little project?
2010-06-07 21:09:26
2010-06-07 21:26:59
2010-06-08 04:41:36
2010-06-08 13:10:19
2010-06-08 16:41:22
From: Rasta Magician
I just re-read your post. Your little project sounds good ;)
~RM
2010-06-08 17:40:05
From: nickrules
ah, thanks :P anybody want to suggest something to add?
@RM
I can't remember where I read this, but there was a poll about supporting personal projects like SPAMS2. Anyway, my thought was, what if you used SPAMS2 once at the beginning of the script, and as it walked, you logged where/when you clicked the mouse on the minimap, storing it into an array of some sort. This array could be used as a path, loaded into a walking procedure, and then reverse the array and use it for a return path.
2010-06-08 21:45:23
HATCHET_BRONZE..HATCHET_RUNE:
Result := [ 586, 243, 587, 249, 574, 261, 575, 248, 587, 240 ];in that little example from iteminfo.scar's MSI_GetDTMInfo function, what are the numbers for?2010-06-08 22:37:12
From: nickrules
Does anybody have any more suggestions for this? otherwise, I wouldn't mind some assistance on how to add this into the MSI, so that it can be tested.
And, for adding items, I don't understand how (D)DTMs are set up for items in MSI.in that little example from iteminfo.scar's MSI_GetDTMInfo function, what are the numbers for?HATCHET_BRONZE..HATCHET_RUNE:
Result := [ 586, 243, 587, 249, 574, 261, 575, 248, 587, 240 ];
is 586, and 243 the x and y for one point?
and then 587 the x for another point, and 247 the y?
2010-06-09 11:08:05
2010-06-09 11:11:15
2010-06-09 11:16:24
From: Frement
So we can write new scripts to MSI?
2010-06-09 17:16:50
2010-06-10 00:16:39
RUNES_AIR..RUNES_CHAOS:
Result := [ 912, 435, 912, 449, 919, 423, 898, 439, 926, 435 ];RUNE_AIR: Result := 13882333;
RUNE_BODY: Result := 855309;
RUNE_MIND: Result := 472373;
RUNE_EARTH: Result := 801369;
RUNE_WATER: Result := 10164502;
RUNE_FIRE: Result := 1450139;
RUNE_LAW: Result := 13968158;
RUNE_NATURE: Result := 1342481;
RUNE_CHAOS: Result := 2005717; STAFF_AIR..STAFF_FIRE:
Result := [ 869, 598, 868, 596, 865, 604, 879, 583, 860, 610 ]; STAFF_AIR: Result := 1003888;
STAFF_WATER: Result := 1003888;
STAFF_EARTH: Result := 1003888;
STAFF_FIRE: Result := 1003888; OBJ_ENEMY_EVILMONK: // nickrules
With Result Do
Begin
Name := 'Evil Monk';
UpText := 'onk of Zam';
Option := 'Cast';
Colors := [10058855,8809562,7889233,10518892];
Exp := 29;
Tol := 14;
Hue := 0.6;
Sat := 0.11;
FindAllColors := False;
W := 20;
H := 30;
Accuracy := 10;
ExcludeSelf := True;
RightClickOnly := False;
Tries := 5;
Anim := true;
WaitToMove := False;
BadColors := [];
BadColorTolerance := 10;
End;2010-06-10 07:16:51
{==============================================================================\
| MSI Group Scripting Include |
| Magic.scar |
|==============================================================================|
| For all woodcutting routines. |
| |
| * function MSI_ResetSpellbook(); * by nickrules |
| * function MSI_Curse(): Boolean; * by nickrules |
| * function MSI_Alch(): Boolean; * by nickrules |
\ _____________________________________________________________________________}
//http://villavu.com/repositories/srl-opendev/SRL/skill/Magic.scar
//Spellbook functions are already available
//took the time to fix standards as well
function MSI_ResetSpellbook: boolean;
var
DTM,x,y: integer;
begin
//gametab(28);
gametab(tab_magic);
//these DTMs should be loaded from somewhere central.
//Maybe we need to make MSI_LoadDTM
DTM := DTMFromString('78DA630C60626038C0C8800C5EDD3C0AA661A' +
'28CEE986AFEFDFB87AA2618A8E60C01358140353BF1AB010073E3' +
'0FCB');
{
if not finddtm(dtm,x,y,MIX1,MIY1,MIX2,MIY2) then
//begin --> no need for being & end, as it is only one line
mouse(592,451,5,5,true);
//end;
}
if not findDTM(DTM, x, y, MIX1, MIY1, MIX2, MIY2) then
mouse(592, 451, 5, 5, true);
FreeDTM(DTM);
{
you have to free the DTM,
because when you load another one you lose the
'refference' to this one and therefore
memory leak
}
DTM := DTMFromString('78DA634C63626038C2C8800A189148209D025' +
'4B31355CDBF7FFF50D5E4639A83A12615A8E60C0135B140358750' +
'D58808F1A0A8010073BD0F05');
if(not(finddtm(dtm,x,y,MIX1,MIY1,MIX2,MIY2)))then
begin
mouse(614,451,5,5,true);
end;
DTM := DTMFromString('78DA63AC62626038C2C88002BA0F832998286' +
'32150CD515435FFFEFD43550332672701352D4035878830E734AA' +
'1A11211E14350068D510BA');
if(not(finddtm(dtm,x,y,MIX1,MIY1,MIX2,MIY2)))then
begin
mouse(634,451,5,5,true);
end;
DTM := DTMFromString('78DA639CC0C4C070849101196C8BF402D3305' +
'1C6764C3522423CA86AFA816ACEA0AAF9F7EF1FAA9A3EA09A5D04' +
'CC9909547310BF3900E5CD0E67');
if(not(finddtm(dtm,x,y,MIX1,MIY1,MIX2,MIY2)))then
begin
mouse(654,451,5,5,true);
end;
DTM := DTMFromString('78DA639CC0C4C070849101196C8BF402D3305' +
'1C6764C3522423CA86AFA816ACEA0AAF9F7EF1FAA9A3EA09A5D04' +
'CC9909547310BF3900E5CD0E67');
if(not(finddtm(dtm,x,y,MIX1,MIY1,MIX2,MIY2)))then
begin
mouse(684,451,5,5,true);
end;
DTM := DTMFromString('78DA633462626038CCC88002422AC1144C945' +
'113A8E620AA9A7FFFFEA1AA0199B393801A2BA09A43A86A9ACA53' +
'50D59863BAA7B212D53D003EED0E63');
if(finddtm(dtm,x,y,MIX1,MIY1,MIX2,MIY2))then
begin
mouse(562,451,5,5,true);
end;
result := true;
FreeDTM(DTM);
end;
Function MSI_Curse(which: Integer): boolean;
var
x, y: integer;
monk: TMSObject;
begin
monk := MSI_GetObject(Which);
repeat
MSI_FindRandoms;
MSI_AntiBan(RandomRange(0, 5000), ANTI_BAN_CHANCE);
MSI_ResetSpellbook;
if(FindColorTolerance(x,y,14165953,679,243,704,264,10))then //Is the spell lit up? (castable)
begin
mouse(692,255,8,8,true);
if(not(MSI_FindObject(monk, ClickLeft))) then
begin
//you might want failsafes instead of just setting the player to false
writeln(':| something failed...');
result := false;
NextPlayer(false);
exit;
end;
end;
until(false);
end;
Function MSI_Alch(item: integer): boolean;
var
x,y, DTM: integer;
begin
//MSI_LoadDTM
DTM := DTMFromString('78DA633CCECCC070929101196832338169982' + //high alch DTM
'8E30EA09A0BA86AA418D1D49C01AA398FAA86119D3E0954B31FBF1A0' +
'0473706A1');
MSI_ResetSpellbook;
repeat
MSI_FindRandoms;
MSI_AntiBan(RandomRange(0, 4000), ANTI_BAN_CHANCE);
if(not(finddtm(DTM,x,y,MIX1,MIY1,MIX2,MIY2)))then
begin
writeln('couldn''t find the high alch spell. exiting...');
result := false;
exit;
end;
mouse(x,y,8,8,true);
wait(randomrange(150,500));
MSI_ClickItems([item], ['Cast','High','ast','igh','evel']);
wait(randomrange(1500,2000));
until(false);
freedtm(dtm);
end;
2010-06-10 08:56:10
From: Rasta Magician
About the rune & staff DTMS:
when choosing the main point color, try to choose a color unique to that item.
~RM
2010-06-10 09:20:55
From: nickrules
Oh wow, thanks.
fixed the colors for staves
STAFF_AIR: Result := 12235185;
STAFF_WATER: Result := 13115676;
STAFF_EARTH: Result := 4544635;
STAFF_FIRE: Result := 1845704;
and the dtm
STAFF_AIR..STAFF_FIRE:
Result := [ 878, 503, 859, 527, 877, 499, 871, 514, 874, 507 ];
All the colors on the runes should not be too similar, except for chaos… Could always just comment it out, as the air rune has the exact same color as the center of the chaos rune.
As for the begins and ends, I know its not needed, but I keep them there, because for me personally, its easier to follow whats happening in the code.
I was aware that SRL had its own reset spellbook, but I didn't want to include something else, and tbh, wanted to make my own.
2010-06-10 10:09:59
{==============================================================================\
| MSI Group Scripting Include |
| Magic.scar |
|==============================================================================|
| For all woodcutting routines. |
| |
| * function MSI_ResetSpellbook(); * by nickrules |
| * function MSI_Curse(): Boolean; * by nickrules |
| * function MSI_Alch(): Boolean; * by nickrules |
\ _____________________________________________________________________________}
//{.include srl/srl/msi/setup.scar} //used to see if it compiled....
{.include srl/srl/skill/magic.scar}
{*****************************************************************************}
{ function MSI_ResetSpellbook: boolean; }
{ By: Nickrules }
{ Date: 10 June 2010 }
{ Description: Resets the spellbook to defaults. Yes, I know SRL has one too. }
{*****************************************************************************}
function MSI_ResetSpellbook: boolean;
var
DTM,x,y: integer;
begin
gametab(tab_magic);
DTM := DTMFromString('78DA630C60626038C0C8800C5EDD3C0AA661A' +
'28CEE986AFEFDFB87AA2618A8E60C01358140353BF1AB010073E3' +
'0FCB');
if not findDTM(DTM, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
mouse(592, 451, 5, 5, true);
end;
FreeDTM(DTM);
DTM := DTMFromString('78DA634C63626038C2C8800A189148209D025' +
'4B31355CDBF7FFF50D5E4639A83A12615A8E60C0135B140358750' +
'D58808F1A0A8010073BD0F05');
if not finddtm(dtm,x,y,MIX1,MIY1,MIX2,MIY2) then
begin
mouse(614,451,5,5,true);
end;
FreeDTM(DTM);
DTM := DTMFromString('78DA63AC62626038C2C88002BA0F832998286' +
'32150CD515435FFFEFD43550332672701352D4035878830E734AA' +
'1A11211E14350068D510BA');
if(not(finddtm(dtm,x,y,MIX1,MIY1,MIX2,MIY2)))then
begin
mouse(634,451,5,5,true);
end;
FreeDTM(DTM);
DTM := DTMFromString('78DA639CC0C4C070849101196C8BF402D3305' +
'1C6764C3522423CA86AFA816ACEA0AAF9F7EF1FAA9A3EA09A5D04' +
'CC9909547310BF3900E5CD0E67');
if(not(finddtm(dtm,x,y,MIX1,MIY1,MIX2,MIY2)))then
begin
mouse(654,451,5,5,true);
end;
FreeDTM(DTM);
DTM := DTMFromString('78DA639CC0C4C070849101196C8BF402D3305' +
'1C6764C3522423CA86AFA816ACEA0AAF9F7EF1FAA9A3EA09A5D04' +
'CC9909547310BF3900E5CD0E67');
if(not(finddtm(dtm,x,y,MIX1,MIY1,MIX2,MIY2)))then
begin
mouse(684,451,5,5,true);
end;
FreeDTM(DTM);
DTM := DTMFromString('78DA633462626038CCC88002422AC1144C945' +
'113A8E620AA9A7FFFFEA1AA0199B393801A2BA09A43A86A9ACA53' +
'50D59863BAA7B212D53D003EED0E63');
if(finddtm(dtm,x,y,MIX1,MIY1,MIX2,MIY2))then
begin
mouse(562,451,5,5,true);
end;
result := true;
FreeDTM(DTM);
end;
{*****************************************************************************}
{ function MSI_Curse(which: Integer): boolean; }
{ By: Nickrules }
{ Date: 10 June 2010 }
{ Description: Curses the NPC defined by which. }
{*****************************************************************************}
Function MSI_Curse(which: Integer): boolean;
var
x, y: integer;
NPC: TMSObject;
begin
MSI_Debug('MSI_Curse','Starting cursing...', Debug_Functions);
NPC := MSI_GetObject(Which);
makecompass('w');
MSI_ResetSpellbook;
repeat
MSI_FindRandoms;
MSI_AntiBan(RandomRange(0, 5000), ANTI_BAN_CHANCE);
if not cast('curse',false) then
begin
MSI_Debug('MSI_Curse','Couldn''t cast curse for whatever reason.', 10);
nextplayer(false);
result := false;
end;
MSI_FindObject(NPC,ClickLeft);
until(false);
end;
{*****************************************************************************}
{ function MSI_Alch(item: Integer): boolean; }
{ By: Nickrules }
{ Date: 10 June 2010 }
{ Description: High Alchs the item defined by item }
{*****************************************************************************}
Function MSI_Alch(item: integer): boolean;
var
x,y, DTM: integer;
begin
//MSI_LoadDTM
DTM := DTMFromString('78DA633CCECCC070929101196832338169982' + //high alch DTM
'8E30EA09A0BA86AA418D1D49C01AA398FAA86119D3E0954B31FBF1A0' +
'0473706A1');
MSI_Debug('MSI_Alch','Alching time :D', Debug_Functions);
MSI_ResetSpellbook;
repeat
MSI_FindRandoms;
MSI_AntiBan(RandomRange(0, 4000), ANTI_BAN_CHANCE);
if not cast('high level alchemy',false) then
begin
MSI_Debug('MSI_Alch','Couldn''t cast high level alchemy.', 10);
result := false;
exit;
end;
mouse(x,y,8,8,true);
wait(randomrange(150,500));
MSI_ClickItems([item], ['Cast','High','ast','igh','evel']);
wait(randomrange(1500,2000));
until(false);
freedtm(dtm);
end;
2010-06-10 10:34:58
2010-06-10 11:58:27
2010-06-10 12:18:32
From: nickrules
I've tested everything that can be tested without modifying a ton of things in MSI (basically, if its an MSI function, I've commented it out.). and it works well. I think I will get around to making it run with MSI later today (or tomorrow, as I have plenty of plans for today), that way I can truly test it.
2010-06-10 12:23:55
2010-06-17 11:27:35
2010-06-17 17:52:40
From: nickrules
@Coh3n, Thanks for the link. It was fairly helpful, but I get an unknown identifier 'SKILL_MAGIC'. This shows up first in the mainloops Getbesttool function. So where exactly would I add skill_magic in this, so that I don't get that error?
From: nickrules
Also, multiple tools? Many skills require more than just one tool. Magic requires multiple runes, fishing needs bait/feathers (sometimes). Firemaking would require logs and a tinderbox. My point is, what about an array of tools? I don't think it would take too much work to modify the functions, but I'm not too sure…
From: nickrules
I was getting an error (probably just my fault….) in reflection walking (unknown identifier reflectionbroken, or thereabouts), so i just tinkered around with that and *fixed* it.
From: nickrules
I attached what I've done to my MSI folder if anyone is interested, although I've only modified
setup
objects
iteminfo
debug
mainloop
and globals
Also, MSI_ObjToText was removed(?), so I wont need to do anything with that anymore? (refering to this thread)
2010-06-17 19:16:04
2010-06-17 23:12:05
From: Rasta Magician
skill_magic is in srl already. No need to add it in msi.
~RM
2010-06-18 10:31:31
From: Coh3n
That shouldn't happen… what did you do to fix it?
function MSI_PerformWalk(startLoc, endLoc: Integer): Boolean;
begin
MakeCompass('n');
RunEnergy(20);
{$IFDEF REFLECTION}
Result := MSI_ReflectionWalk(startLoc, endLoc);
{$ELSE}
Result := MSI_ColorWalk(startLoc, endLoc);
{$ENDIF}
end;Thats what I did. Its a lot more flawed with a higher chance for something to go wrong, but I don't use reflection anyway, as I have found colour walking to be many times more reliable. is it because i'm running scar? I'll have to try it out in simba later…From: Coh3n
I've updated that thread and I also added the constants thing. Also, is there any way you can post the individual procedures you wrote/changed? It would make it a lot easier for us and it is a big include. I don't have the time to looks through all the files right now, but hopefully we can get this added soon. :)
GLOBALS.SCAR
OBJ_ENEMY_EVILMONK = 10;
MSI_ITEM_COUNT = 24; //Is this number even correct?
RUNE_AIR = 17;
RUNE_BODY = 18;
RUNE_MIND = 19;
RUNE_EARTH = 20;
RUNE_WATER = 21;
RUNE_FIRE = 22;
RUNE_LAW = 23;
RUNE_NATURE = 24;
//RUNE_CHAOS = 26
STAFF_AIR = 27;
STAFF_WATER = 28;
STAFF_EARTH = 29;
STAFF_FIRE = 30;
REQ_HIGHALCH = 55; //I might add a
REQ_CURSE = 19;From: Coh3n
Oh, and what "Script" did you add exactly? Like what exactly does it do when you choose to do Magic in the DeclarePlayers? Have you tested this script? Does the progress report work with what you changed? Just things I'd like to know so I can help along the developing process. :)
2010-06-18 15:42:02
From: nickrules
Thats what I did. Its a lot more flawed with a higher chance for something to go wrong, but I don't use reflection anyway, as I have found colour walking to be many times more reliable. is it because i'm running scar? I'll have to try it out in simba later…function MSI_PerformWalk(startLoc, endLoc: Integer): Boolean;
begin
MakeCompass('n');
RunEnergy(20);
{$IFDEF REFLECTION}
Result := MSI_ReflectionWalk(startLoc, endLoc);
{$ELSE}
Result := MSI_ColorWalk(startLoc, endLoc);
{$ENDIF}
end;
From: nickrules
DEBUG.SCAR
I commented this line in MSI_ProgressReport;
//MSI_PrintSave(FileH, '{ ' + PadR('City: ' + PlayerCity, 59) + '}');
From: nickrules
SETUP.SCAR
Just added my magic.scar to the include list…
From: nickrules
GLOBALS.SCAR
OBJ_ENEMY_EVILMONK = 10;
MSI_ITEM_COUNT = 24; //Is this number even correct?
RUNE_AIR = 17;
RUNE_BODY = 18;
RUNE_MIND = 19;
RUNE_EARTH = 20;
RUNE_WATER = 21;
RUNE_FIRE = 22;
RUNE_LAW = 23;
RUNE_NATURE = 24;
//RUNE_CHAOS = 26
STAFF_AIR = 27;
STAFF_WATER = 28;
STAFF_EARTH = 29;
STAFF_FIRE = 30;
REQ_HIGHALCH = 55; //I might add a
REQ_CURSE = 19;
2010-06-19 15:04:24
2010-06-20 09:25:33
2010-06-20 20:02:18
From: nickrules
@RM what exactly would a TSpell be? and how would it be used? sorry, im noob :P
type
TSpell = record
name: string;
requiredLevel: integer;
bookLocation: TBox;
end;
Something like that.
2010-06-20 20:05:43
2010-06-20 20:11:44
From: Frement
Basically a structure in other languages :) (C++)
2010-06-20 23:04:20
2010-06-20 23:58:03
From: nickrules
So would a TSpell even be needed? Although, with a TSpell, coords could be stored for every spell, name, etc.
My point is, a generic spell casting gizmo of sorts could be made (from scratch) with this. However, if SRL already has something for casting any spell, does the MSI project have any need for a new one?
2010-06-21 06:03:45
From: nickrules
So would a TSpell even be needed? Although, with a TSpell, coords could be stored for every spell, name, etc.
My point is, a generic spell casting gizmo of sorts could be made (from scratch) with this. However, if SRL already has something for casting any spell, does the MSI project have any need for a new one?
2010-06-21 10:12:57
From: Coh3n
Well, MSI_Cast would be a function that casts a spell on any TMSObject. So, it would use SRL's Cast, along with the other necessary code for casting on an object.
2010-06-21 10:57:29
From: nickrules
I figured thats what you intended. I'll get to work on that in a smidge. I'll also try an make it capable of interacting with the inventory….
2010-06-21 11:13:32
From: Frement
Can you explain why it needs to interact with the inventory?
2010-06-21 11:26:27
From: nickrules
several spells interact with the inventory. alchs, superheat, enchants, etc.
2010-06-21 11:49:10
From: Frement
So the TSPell should have some kind of interact variable? Which could be used to identify that.
From: Frement
I don't think it needs coords as the SRL's Cast() already does that.
2010-06-21 18:08:41
2010-06-21 21:59:29
2010-06-22 06:01:59
From: nickrules
Also, Coh3n, I was under the impression that the casting function (for MSI) should automatically interact with a given object, right? What I was saying is that it should automatically be capable of also interacting with the inventory using the MSI clickitems function. Sorry if i was unclear about that.
2010-06-29 10:06:46
Function MSI_Cast(spellname: string; which: TIntegerArray; IsObject: boolean): boolean;
var
NPC: TMSObject;
begin
if not cast(spellname, false) then
begin
MSI_DEBUG('MSI_Cast','Casting failed',10);
exit;
end;
if IsObject then
begin
NPC := MSI_GetObjects([Which]);
if MSI_FindObject(NPC,ClickLeft) then
begin
result := true;
exit;
end;
MSI_Debug('MSI_Cast','Object finding failed',5);
result := false;
exit;
end;
if MSI_ClickItems([which],'ast') then
begin
result := true;
exit;
end;
MSI_Debug('MSI_Cast','Item finding failed',5);
result := false;
exit;
end;2010-06-29 19:58:53
//the parameter which needs to be just an integer as you've put it in [] in the function
function MSI_Cast(spellname: string; which: integer; IsObject: boolean): boolean;
var
NPC: TMSObject;
begin
if not cast(spellname, false) then
begin
MSI_DEBUG('MSI_Cast','Casting failed', DEBUG_FUNCTIONS); //use constants here
exit;
end;
if IsObject then
begin
NPC := MSI_GetObjects([Which]);
result := MSI_FindObject(NPC, ClickLeft);
if (not result) then
MSI_Debug('MSI_Cast','Object finding failed', DEBUG_FUNCTIONS);
end else
if MSI_ClickItems([which],'ast') then
begin
result := true;
exit;
end else
MSI_Debug('MSI_Cast','Item finding failed',5);
end;
2010-07-15 22:41:12
2010-07-15 23:26:29
From: nickrules
blah. Its been awhile since I've been on SRL. MSI seems to be about 40 revisions ahead of me xD
I'll see what needs updating and update it. Then, unless there is an amazing tutorial on how to, i'll need help on making it "work" with MSI. And finally, someone would need to commit it.
2010-07-16 23:44:06
2010-07-17 00:45:09
From: nickrules
Bleh, I'm not sure how well the new function (MSI_Loop_Cast, just added it) will work, or, if it even compiles (running xubuntu, simba doesn't seem to work well…)
Doh! (forgot to upload file.) Have fun SLs
{==============================================================================\
| MSI Group Scripting Include |
| Magic.scar |
|==============================================================================|
| For all woodcutting routines. |
| |
| * function MSI_ResetSpellbook(); * by nickrules |
| * function MSI_Curse(): Boolean; * by nickrules |
| * function MSI_Alch(): Boolean; * by nickrules |
\ _____________________________________________________________________________}
{.include srl/srl/msi/setup.scar} //used to see if it compiled....
{.include srl/srl/skill/magic.scar}
{*****************************************************************************}
{ function MSI_ResetSpellbook: boolean; }
{ By: Nickrules }
{ Date: 10 June 2010 }
{ Description: Resets the spellbook to defaults. }
{*****************************************************************************}
function MSI_ResetSpellbook: boolean; //is this still needed?
var
DTM,x,y: integer;
begin
gametab(tab_magic);
SortBook(0);
SetSpellMode(True, True, True, True);
ToggleDefCast(False);
{DTM := DTMFromString('78DA630C60626038C0C8800C5EDD3C0AA661A' +
'28CEE986AFEFDFB87AA2618A8E60C01358140353BF1AB010073E3' +
'0FCB');
if not findDTM(DTM, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
mouse(592, 451, 5, 5, true);
end;
FreeDTM(DTM);
DTM := DTMFromString('78DA634C63626038C2C8800A189148209D025' +
'4B31355CDBF7FFF50D5E4639A83A12615A8E60C0135B140358750' +
'D58808F1A0A8010073BD0F05');
if not finddtm(dtm,x,y,MIX1,MIY1,MIX2,MIY2) then
begin
mouse(614,451,5,5,true);
end;
FreeDTM(DTM);
DTM := DTMFromString('78DA63AC62626038C2C88002BA0F832998286' +
'32150CD515435FFFEFD43550332672701352D4035878830E734AA' +
'1A11211E14350068D510BA');
if(not(finddtm(dtm,x,y,MIX1,MIY1,MIX2,MIY2)))then
begin
mouse(634,451,5,5,true);
end;
FreeDTM(DTM);
DTM := DTMFromString('78DA639CC0C4C070849101196C8BF402D3305' +
'1C6764C3522423CA86AFA816ACEA0AAF9F7EF1FAA9A3EA09A5D04' +
'CC9909547310BF3900E5CD0E67');
if(not(finddtm(dtm,x,y,MIX1,MIY1,MIX2,MIY2)))then
begin
mouse(654,451,5,5,true);
end;
FreeDTM(DTM);
DTM := DTMFromString('78DA639CC0C4C070849101196C8BF402D3305' +
'1C6764C3522423CA86AFA816ACEA0AAF9F7EF1FAA9A3EA09A5D04' +
'CC9909547310BF3900E5CD0E67');
if(not(finddtm(dtm,x,y,MIX1,MIY1,MIX2,MIY2)))then
begin
mouse(684,451,5,5,true);
end;
FreeDTM(DTM);
DTM := DTMFromString('78DA633462626038CCC88002422AC1144C945' +
'113A8E620AA9A7FFFFEA1AA0199B393801A2BA09A43A86A9ACA53' +
'50D59863BAA7B212D53D003EED0E63');
if(finddtm(dtm,x,y,MIX1,MIY1,MIX2,MIY2))then
begin
mouse(562,451,5,5,true);
end;
result := true;
FreeDTM(DTM); }
end;
{*****************************************************************************}
{ function MSI_Cast(spellname: string; which: integer; IsObject: boolean): boolean;}
{ By: Nickrules }
{ Date: 28 June 2010 }
{ Description: Casts a given spell on a given object/item. }
{*****************************************************************************}
Function MSI_Cast(spellname: string; which: Integer; IsObject: boolean): boolean;
var
NPC: TMSObject; //don't need this since we can use MSI_Objects
begin
if not cast(spellname, false) then
begin
MSI_DEBUG('MSI_Cast','Casting failed', DEBUG_FUNCTIONS); //always use the debug constants here
exit;
end;
if IsObject then
begin
if MSI_FindObject(MSI_Objects[Which], ClickLeft) then
begin
result := true;
exit;
end;
MSI_Debug('MSI_Cast','Object finding failed',5);
result := false;
exit;
//the above part can be written better; no exit is required because we'll be using an else
Result := MSI_FindObject(NPC, ClickLeft);
if (not Result) then
MSI_Debug('MSI_Cast', 'Object finding failed', DEBUG_FUNCTIONS);
end else //see how now exit will be necessary
begin //this part can also be written better (like above)
if MSI_ClickItems(which, ['ast']) then
begin
result := true;
exit;
end;
MSI_Debug('MSI_Cast','Item finding failed',5);
result := false;
exit;
end;
end;
//shortened version
function MSI_Cast(spellName: string; castOn: Integer; isObject: Boolean): Boolean;
begin
if (not Cast(spellName, false)) then
begin
MSI_Debug('MSI_Cast','Casting failed', DEBUG_FUNCTIONS);
exit;
end;
if (isObject) then
begin
Result := MSI_FindObject(MSI_Objects[castOn], ClickLeft);
if (not Result) then
MSI_Debug('MSI_Cast', 'Object finding failed', DEBUG_FUNCTIONS);
end else
begin
Result := MSI_ClickItems(castOn, ['ast']);
if (not Result) then
MSI_Debug('MSI_Cast','Item finding failed',5);
end;
end;
Procedure MSI_Loop_Cast(spellname: string; which, waittime, totalcasts: Integer; IsObject: boolean);
var
CastSoFar, fails: intger;
anotherVar: boolean;
begin
if totalcasts = 0 then
begin
totalcasts := 9999999999;
end;
while castssofar to totalcasts do
begin //point 1
If not MSI_Cast(spellname, which,IsObject) then //if it fails, do all this shit
begin
inc(fails);
MSI_DEBUG('MSI_Loop_Cast','something failed. Fails so far: '+inttostr(fails), 3);
MSI_DEBUG('MSI_Loop_Cast','trying 5 more times.', 3);
repeat
//point 2
AnotherVar := MSI_Cast(spellname, which,IsObject); //determine the result, storing it to be tested
if anotherVar then //if we got it, do this, and break the loop, returning to point 1
begin
Writeln('MSI_Cast Returned true. Breaking failsafe loop');
Writeln('We got it on try number '+inttostr(failsafe)+' out of 5');
MSI_DEBUG('MSI_Loop_Cast','unce unce ucne - meltdown averted', 10);
failsafe := 0
break;
end;
If not AnotherVar then //if the failsafe cast failed...
begin
inc(failsafe); //increase var and write crap
writeln('Returned false on try number '+inttostr(failsafe)+'out of 5');
if (failsafe >= 5) then //but, if failsafe is 5 or greater...
begin
MSI_DEBUG('MSI_Loop_Cast','Casting failed 5 times. Terminating script', 10);
TerminateScript; //blow it up.
end;
end; //of course if its not, go to point two, and try, try again.
until((failsafe >= 5) or anotherVar = true);// uh... yeah.
end else //If it worked fine, increase some crap, do some waiting, etc.
begin
Wait(waittime);
inc(CastSoFar);
end; // and then back to the while to do loop :D
end;
MSI_DEBUG('MSI_Loop_Cast', inttostr(CastsSoFar)+' casts, with '+IntToStr(fails)+' failed casts.', 7)
end;
//////////////////////////////////
/////unnessisary procedures(?)////
//////////////////////////////////
{*****************************************************************************}
{ function MSI_Curse(which: Integer): boolean; }
{ By: Nickrules }
{ Date: 10 June 2010 }
{ Description: Curses the NPC defined by which. }
{*****************************************************************************}
Function MSI_Curse(which: Integer): boolean;
var
x, y: integer;
NPC: TMSObject;
begin
MSI_Debug('MSI_Curse','Starting cursing...', Debug_Functions);
NPC := MSI_GetObject(Which);
makecompass('w');
MSI_ResetSpellbook;
repeat
MSI_FindRandoms;
MSI_AntiBan(RandomRange(0, 5000), ANTI_BAN_CHANCE);
if not cast('curse',false) then
begin
MSI_Debug('MSI_Curse','Couldn''t cast curse for whatever reason.', 10);
nextplayer(false);
result := false;
end;
MSI_FindObject(NPC,ClickLeft);
until(false);
end;
{*****************************************************************************}
{ function MSI_Alch(item: Integer): boolean; }
{ By: Nickrules }
{ Date: 10 June 2010 }
{ Description: High Alchs the item defined by item }
{*****************************************************************************}
Function MSI_Alch(item: TIntegerArray): boolean;
var
x,y, DTM: integer;
begin
//MSI_LoadDTM
DTM := DTMFromString('78DA633CCECCC070929101196832338169982' + //high alch DTM
'8E30EA09A0BA86AA418D1D49C01AA398FAA86119D3E0954B31FBF1A0' +
'0473706A1');
MSI_Debug('MSI_Alch','Alching time :D', Debug_Functions);
MSI_ResetSpellbook;
repeat
MSI_FindRandoms;
MSI_AntiBan(RandomRange(0, 4000), ANTI_BAN_CHANCE);
if not cast('high level alchemy',false) then
begin
MSI_Debug('MSI_Alch','Couldn''t cast high level alchemy.', 10);
result := false;
exit;
end;
mouse(x,y,8,8,true);
wait(randomrange(150,500));
MSI_ClickItems([item], 'gh al');
wait(randomrange(1500,2000));
until(false);
freedtm(dtm);
end;
Now, what's MSI_Loop_Cast suppose to do? Just repeatedly cast the same spell a certain amount of times? If so, I was thinking maybe we could have an MSI_CastObject and MSI_CastItem, and have repeating loops in those functions. There would also be a parameter for how many spells to cast. What do you think?
2010-07-18 10:19:19
{==============================================================================\
| MSI Group Scripting Include |
| Magic.scar |
|==============================================================================|
| For all magic routines. |
| |
| * function MSI_ResetSpellbook(); * by nickrules |
| * function MSI_Cast(): Boolean; * by nickrules |
| * function MSI_Cast_item(): Boolean; * by nickrules |
| * function MSI_Cast_Obj(): Boolean; * by nickrules |
| * function MSI_Loop_Cast(): Boolean; * by nickrules |
| * function MSI_Curse(): Boolean; * by nickrules |
| * function MSI_Alch(): Boolean; * by nickrules |
\ _____________________________________________________________________________}
{.include srl/srl/msi/setup.scar} //for test compiling. no touchy.
{.include srl/srl/skill/magic.scar}
//Quick shoutout to Coh3n, Thanks for the help/ideas. really helped this
//include get to where it is. -NR
{*****************************************************************************}
{ function MSI_ResetSpellbook: boolean; }
{ By: Nickrules }
{ Date: 10 June 2010 }
{ Description: Resets the spellbook to defaults. }
{*****************************************************************************}
function MSI_ResetSpellbook: boolean; //is this still needed?
var
DTM,x,y: integer;
begin
gametab(tab_magic);
SortBook(0);
SetSpellMode(True, True, True, True);
ToggleDefCast(False);
{DTM := DTMFromString('78DA630C60626038C0C8800C5EDD3C0AA661A' +
'28CEE986AFEFDFB87AA2618A8E60C01358140353BF1AB010073E3' +
'0FCB');
if not findDTM(DTM, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
mouse(592, 451, 5, 5, true);
end;
FreeDTM(DTM);
DTM := DTMFromString('78DA634C63626038C2C8800A189148209D025' +
'4B31355CDBF7FFF50D5E4639A83A12615A8E60C0135B140358750' +
'D58808F1A0A8010073BD0F05');
if not finddtm(dtm,x,y,MIX1,MIY1,MIX2,MIY2) then
begin
mouse(614,451,5,5,true);
end;
FreeDTM(DTM);
DTM := DTMFromString('78DA63AC62626038C2C88002BA0F832998286' +
'32150CD515435FFFEFD43550332672701352D4035878830E734AA' +
'1A11211E14350068D510BA');
if(not(finddtm(dtm,x,y,MIX1,MIY1,MIX2,MIY2)))then
begin
mouse(634,451,5,5,true);
end;
FreeDTM(DTM);
DTM := DTMFromString('78DA639CC0C4C070849101196C8BF402D3305' +
'1C6764C3522423CA86AFA816ACEA0AAF9F7EF1FAA9A3EA09A5D04' +
'CC9909547310BF3900E5CD0E67');
if(not(finddtm(dtm,x,y,MIX1,MIY1,MIX2,MIY2)))then
begin
mouse(654,451,5,5,true);
end;
FreeDTM(DTM);
DTM := DTMFromString('78DA639CC0C4C070849101196C8BF402D3305' +
'1C6764C3522423CA86AFA816ACEA0AAF9F7EF1FAA9A3EA09A5D04' +
'CC9909547310BF3900E5CD0E67');
if(not(finddtm(dtm,x,y,MIX1,MIY1,MIX2,MIY2)))then
begin
mouse(684,451,5,5,true);
end;
FreeDTM(DTM);
DTM := DTMFromString('78DA633462626038CCC88002422AC1144C945' +
'113A8E620AA9A7FFFFEA1AA0199B393801A2BA09A43A86A9ACA53' +
'50D59863BAA7B212D53D003EED0E63');
if(finddtm(dtm,x,y,MIX1,MIY1,MIX2,MIY2))then
begin
mouse(562,451,5,5,true);
end;
result := true;
FreeDTM(DTM); }
end;
{*****************************************************************************}
{ function MSI_Cast_Item(spellname: string; what: integer): boolean; }
{ By: Nickrules }
{ Date: 28 June 2010 }
{ Description: Casts a given spell on a given object/item. }
{*****************************************************************************}
function MSI_Cast_Item(spellname: string; what: integer): boolean;
begin
if (not Cast(spellName, false)) then
begin
MSI_Debug('MSI_Cast_Item','Casting failed', DEBUG_FUNCTIONS);
exit;
end;
Result := MSI_ClickItems(what, ['ast']);
if (not Result) then
begin
MSI_Debug('MSI_Cast_Item','Item finding failed',5);
end;
end;
{*****************************************************************************}
{ function MSI_Cast_Obj(spellname: string; what: integer): boolean; }
{ By: Nickrules, shortened by Coh3n. Thanks. }
{ Date: 28 June 2010 }
{ Description: Casts a given spell on a given object/item. }
{*****************************************************************************}
function MSI_Cast_Obj(spellname: string; what: integer): boolean;
begin
if (not Cast(spellName, false)) then
begin
MSI_Debug('MSI_Cast_Obj','Casting failed', DEBUG_FUNCTIONS);
exit;
end;
Result := MSI_FindObject(MSI_Objects[castOn], ClickLeft);
if (not Result) then
MSI_Debug('MSI_Cast_Obj', 'Object finding failed', DEBUG_FUNCTIONS);
end;
{*****************************************************************************}
{ function MSI_Cast(spellname: string; castOn: integer; IsObject: boolean): boolean;}
{ By: Nickrules }
{ Date: 28 June 2010 }
{ Description: Casts a given spell on a given object/item. }
{*****************************************************************************}
function MSI_Cast(spellName: string; castOn: Integer; isObject: Boolean): Boolean;
begin
MSI_AntiBan(5000, 40);
if (isObject) then
begin
Result := MSI_Cast_Obj(spellName, CastOn);
end else
begin
Result := MSI_Cast_Item(spellName, castOn);
end;
end;
{*****************************************************************************}
{ function MSI_Loop_Cast(spellname: string; which: integer; IsObject: boolean): boolean;}
{ By: Nickrules } }
{ Date: 17 July 2010 }
{ Description: Casts a given spell on a given object/item, the number }
{ *of times, as determined by totalCasts, with a wait of waitTime(ms) }
{ *in between. set totalCasts to 0 to cast forever(kinda) }
{*****************************************************************************}
Procedure MSI_Loop_Cast(spellname: string; which, waitTime, totalCasts: Integer; IsObject: boolean);
var
CastSoFar, fails: intger;
anotherVar: boolean;
begin
if (totalcasts = 0) then
begin
totalcasts := 9999999999; //If you can actually cast this many times in one proggy, i will mail you a cookie (maybe) lol.
end;
while castssofar to totalcasts do
begin //point 1
If not MSI_Cast(spellname, which,IsObject) then //if it fails, do all this shit
begin
inc(fails);
MSI_DEBUG('MSI_Loop_Cast','something failed. Fails so far: '+inttostr(fails), 3);
MSI_DEBUG('MSI_Loop_Cast','trying 5 more times.', 3);
repeat
//point 2
AnotherVar := MSI_Cast(spellname, which,IsObject); //determine the result, storing it to be tested
if anotherVar then //if we got it, do this, and break the loop, returning to point 1
begin
Writeln('MSI_Cast Returned true. Breaking failsafe loop');
Writeln('We got it on try number '+inttostr(failsafe)+' out of 5');
MSI_DEBUG('MSI_Loop_Cast','unce unce ucne - meltdown averted', 10);
failsafe := 0
break;
end;
If not AnotherVar then //if the failsafe cast failed...
begin
inc(failsafe); //increase var and write crap
writeln('Returned false on try number '+inttostr(failsafe)+'out of 5');
if (failsafe >= 5) then //but, if failsafe is 5 or greater...
begin
MSI_DEBUG('MSI_Loop_Cast','Casting failed 5 times. Terminating script', 10);
TerminateScript; //blow it up.
end;
end; //of course if its not, go to point two, and try, try again.
until((failsafe >= 5) or anotherVar = true);// uh... yeah.
end else //If it worked fine, increase some crap, do some waiting, etc.
begin
Wait(waittime);
inc(CastSoFar);
end; // and then back to the while to do loop :D
end;
MSI_DEBUG('MSI_Loop_Cast', inttostr(CastsSoFar)+' casts, with '+IntToStr(fails)+' failed casts.', 7)
end;
//////////////////////////////////
/////unnessisary procedures(?)////
//////////////////////////////////
{*****************************************************************************}
{ function MSI_Curse(which: Integer): boolean; }
{ By: Nickrules }
{ Date: 10 June 2010 }
{ Description: Curses the NPC defined by which. }
{*****************************************************************************}
Function MSI_Curse(which: Integer): boolean;
var
x, y: integer;
NPC: TMSObject;
begin
MSI_Debug('MSI_Curse','Starting cursing...', Debug_Functions);
NPC := MSI_GetObject(Which);
makecompass('w');
MSI_ResetSpellbook;
repeat
MSI_FindRandoms;
MSI_AntiBan(RandomRange(0, 5000), ANTI_BAN_CHANCE);
if not cast('curse',false) then
begin
MSI_Debug('MSI_Curse','Couldn''t cast curse for whatever reason.', 10);
nextplayer(false);
result := false;
end;
MSI_FindObject(NPC,ClickLeft);
until(false);
end;
{*****************************************************************************}
{ function MSI_Alch(item: Integer): boolean; }
{ By: Nickrules }
{ Date: 10 June 2010 }
{ Description: High Alchs the item defined by item }
{*****************************************************************************}
Function MSI_Alch(item: TIntegerArray): boolean;
var
x,y, DTM: integer;
begin
//MSI_LoadDTM
DTM := DTMFromString('78DA633CCECCC070929101196832338169982' + //high alch DTM
'8E30EA09A0BA86AA418D1D49C01AA398FAA86119D3E0954B31FBF1A0' +
'0473706A1');
MSI_Debug('MSI_Alch','Alching time :D', Debug_Functions);
MSI_ResetSpellbook;
repeat
MSI_FindRandoms;
MSI_AntiBan(RandomRange(0, 4000), ANTI_BAN_CHANCE);
if not cast('high level alchemy',false) then
begin
MSI_Debug('MSI_Alch','Couldn''t cast high level alchemy.', 10);
result := false;
exit;
end;
mouse(x,y,8,8,true);
wait(randomrange(150,500));
MSI_ClickItems([item], 'gh al');
wait(randomrange(1500,2000));
until(false);
freedtm(dtm);
end;
2010-07-31 09:18:03
2010-07-31 09:45:54
2010-07-31 11:16:14
From: Rasta Magician
I'll now be looking at compatibility with SRL.
The only compatibility layer it needs is SpellToText; Magic.scar (SRL's) seems quite vulnerable to breaking, if not broken already by any spell additions.
~RM
2010-07-31 11:19:05
From: Coh3n
How difficult is it to edit them to use constants instead of strings? Would probably break a lot of script though…
A SpellToText wouldn't be that bad I guess. We could also just have a TSpell type (or is there one in SRL?).
2010-07-31 11:22:49
From: Rasta Magician
There is one in SRL.
We could edit SRL to use Variants, but it looks like a LOT of trouble.
I'd say that in terms of that we wait for SRL 5, and that for now we just do SpellToText.
~RM
2010-07-31 20:44:26
2010-08-01 06:15:44
From: nickrules
Woah, A good deal seems to have happened while i was on vacation. So if i understand this correctly, a spellToText function is needed, because SRLs is vournable to breaking because of spell additions.
But why is one needed?
function Cast(whatSpell: string): boolean;
var
str: string;
begin
str := SpellToStr(SPELL_WIND_STRIKE);
Cast(str);
end;
2010-08-01 09:34:10
2010-08-01 17:42:32
Function SpellToStr(lolwut:integer): string;
begin
case lolwut of
SPELL_WIND_STRIKE: result := 'wind strike';
SPELL_WIND_BOLT: result := 'wind bolt';
SPELL_WIND_BLAST: result := 'wind blast';
SPELL_WIND_WAVE: result := 'wind wave';
SPELL_WIND_SURGE: result := 'wind surge';
SPELL_WATER_STRIKE: result := 'water strike';
SPELL_WATER_BOLT: result := 'water bolt';
SPELL_WATER_BLAST: result := 'water blast';
SPELL_WATER_WAVE: result := 'water wave';
SPELL_WATER_SURGE: result := 'water surge';
SPELL_EARTH_STRIKE: result := 'earth strike';
SPELL_EARTH_BOLT: result := 'earth bolt';
SPELL_EARTH_BLAST: result := 'earth blast';
SPELL_EARTH_WAVE: result := 'earth wave';
SPELL_EARTH_SURGE: result := 'earth surge';
SPELL_FIRE_STRIKE: result := 'fire strike';
SPELL_FIRE_BOLT: result := 'fire bolt';
SPELL_FIRE_BLAST: result := 'fire blast';
SPELL_FIRE_WAVE: result := 'fire wave';
SPELL_FIRE_SURGE: result := 'fire surge';
SPELL_GOD_SARA: result := 'saradomin strike';
SPELL_GOD_GUTHIX: result := 'claws of guthix';
SPELL_GOD_ZAMMY: result := 'flames of zamorak';
SPELL_HIT_CRUMBLE: result := 'crumble undead'; //crumble undead
SPELL_HIT_IBAN: result := 'iban blast'; //iban blast
SPELL_SLAYER_DART: result := 'slayer dart';
SPELL_STATE_CONFUSE: result := 'confuse';
SPELL_STATE_WEAKE: result := 'weaken';
SPELL_STATE_CURSE: result := 'curse';
SPELL_STATE_BIND: result := 'bind';
SPELL_STATE_SNARE: result := 'snare';
SPELL_STATE_VULNERABILITY: result := 'vulnerability';
SPELL_STATE_ENFEEBLE: result := 'enfeeble';
SPELL_STATE_ENTANGLE: result := 'entangle';
SPELL_STATE_STUN: result := 'stun';
SPELL_STATE_CHARGE: result := 'charge';
SPELL_STATE_TELEBLOCK: result := 'teleport block';
SPELL_TELE_HOME: result := 'lumbridge home teleport';
SPELL_TELE_ARMY: result := 'mobilising armies teleport'; //mobilizing armies
SPELL_TELE_VARROCK: result := 'varrock teleport';
SPELL_TELE_LUMBY: result := 'lumbridge teleport';
SPELL_TELE_FALLY: result := 'falador teleport';
SPELL_TELE_HOUSE: result := 'teleport to house';
SPELL_TELE_CAMMY: result := 'camelot teleport';
SPELL_TELE_ARDOUGNE: result := 'ardougne teleport';
SPELL_TELE_WATCHTOWER: result := 'watchtower teleport';
SPELL_TELE_TROLLHEIM: result := 'trollheim teleport';
SPELL_TELE_APE: result := 'teleport to ape atoll';
SPELL_TELEOTHER_LUMBY: result := 'teleother lumbridge';
SPELL_TELEOTHER_FALLY: result := 'teleother falador';
SPELL_TELEOTHER_CAMMY: result := 'teleother camelot';
SPELL_ALCH_LOW: result := 'low level alchemy';
SPELL_ALCH_HIGH: result := 'high level alchemy';
SPELL_TELEGRAB: result := 'telekinetic grab';
SPELL_SUPERHEAT: result := 'superheat item';
SPELL_BONES_BANANAS: result := 'bones to bananas';
SPELL_BONES_PEACHS: result := 'bones to peaches';
SPELL_ENCHANT_BOLT: result := 'enchant crossbow bolt';
SPELL_ENCHANT_LVL1: result := 'lvl-1 enchant';
SPELL_ENCHANT_LVL2: result := 'lvl-2 enchant';
SPELL_ENCHANT_LVL3: result := 'lvl-3 enchant';
SPELL_ENCHANT_LVL4: result := 'lvl-4 enchant';
SPELL_ENCHANT_LVL5: result := 'lvl-5 enchant';
SPELL_ENCHANT_LVL6: result := 'lvl-6 enchant';
SPELL_CHARGE_WATER: result := 'charge water orb';
SPELL_CHARGE_EARTH: result := 'charge earth orb';
SPELL_CHARGE_FIRE: result := 'charge fire orb';
SPELL_CHARGE_AIR: result := 'charge air orb';
end;
should work.
2010-08-02 06:25:27
2010-08-02 09:48:39
2010-08-02 10:24:16
From: nickrules
Yeah, i came to pretty much the same conclusion too.
What about a hybrid script? like, mining and then superheating, and then banking? might get a bit complicated.
2010-08-03 14:17:48
2010-08-03 14:48:08
somevariablenameforspells := ['all spell names ect'];
cast(somevariablenameforspells[SPELL_WIND_STRIKE]);
2010-08-03 14:59:08
From: Awkwardsaw
wouldnt an array work just as well for the SpellToString function?
somevariablenameforspells := ['all spell names ect'];
cast(somevariablenameforspells[SPELL_WIND_STRIKE]);
or would it take to long to load/to much memory to load into a single array?
2010-08-03 16:16:14
From: Coh3n
Actually I did this is a farming script I never finished. Have a function return an array with the indexes as the constants. That would make it shorter, but I think it could be a pain to update. I like how the current method is readable and organized though.
2010-08-04 12:38:42
From: Rasta Magician
I gave magic its own little section. Nick, would you like to do the honours of creating the necessary threads to discuss the code & possible scripts? ;) I'll give you a hand with whatever you need.
~RM