{.Script Info: # ScriptName = Nazgands Includes # Author = Nazgand # Description = A few includes. # Version = 2-5 : updated to match squig!! ;D # Date = 8/3/2005 # Comments = if you need help, or have a suggestion, contact me at nazgand@gmail.com /Script Info} {.include squig.txt} const //entire game G1=0; G2=0; G3=765; G4=500; Var ItemsNamesInvin : Array [1..28] of String; procedure Toggle(var Bool:Boolean); begin if (Bool=True)then Bool:=False Else Bool:=True end; procedure SetupNazgand; begin SetupSquig WriteLn(' _/ _/ _/') WriteLn(' _/_/ _/ _/_/_/ _/_/_/_/ _/_/_/ _/_/_/ _/_/_/ _/_/_/') WriteLn(' _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/') WriteLn(' _/ _/_/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/') WriteLn(' _/ _/ _/_/_/ _/_/_/_/ _/_/_/ _/_/_/ _/ _/ _/_/_/') WriteLn(' _/') WriteLn(' _/_/') end; function RangeNum(Range,CenteredOn:integer):integer; //it takes the CenteredOn and randomly add a negative or positive number depending on Range begin if(range=0)then begin range:=1 end Result:=(random(Range*2-1)-Range)+CenteredOn end; {^^^^^^^^^^^^^^^^^ MOUSECR ^^^^^^^^^^^^^^^^^} {Moves the mouse to the location given by a1 and b1 Left clicks if click is 1, right clicks if its 2, 0 for no click.} procedure MouseCR(x1,y1,range,click : integer); begin if(range=0)then begin range:=1 end MoveMouseSmoothEx(RangeNum(range,x1),RangeNum(range,y1),1,6,15,20,20); wait(random(150)+100); if(click=1)then clickhuman(RangeNum(range,x1),RangeNum(range,y1),true) else if(click=2)then clickhuman(RangeNum(range,x1),RangeNum(range,y1),false); end; // 1 Attack style,2 Skills,3 Quest,4 Bag,5 Equip,6 Prayer,7 Magic procedure GameTab(tabnumber:Integer); begin case tabnumber of 1:if(GetColor(559,179)=5531511)then MouseCR(559,186,5,1); 2:if(GetColor(591,176)=5531511)then MouseCR(585,186,5,1); 3:if(GetColor(618,176)=5531511)then MouseCR(614,186,5,1); 4:if(GetColor(636,174)=5531511)then MouseCR(650,186,5,1); 5:if(GetColor(682,174)=5531511)then MouseCR(683,186,5,1); 6:if(GetColor(683,175)=5531511)then MouseCR(711,186,5,1); 7:if(GetColor(734,177)=5531511)then MouseCR(738,186,5,1); 8:if(GetColor(705,495)=5531511)then MouseCR(710,480,5,1); end; Wait(450); end; function ExistsItem(x, y: Integer): Boolean; var xx, yy, f: Integer; Points: TPointArray; begin FindColorsTolerance(Points, 3885652, 569 + x * 42, 228 + y * 36, 569 + x * 42 + 20, 228 + y * 36 + 15, 70) Result:= False; xx:= 0; yy:= 0; for f:= 0 to getarraylength(Points) - 1 do begin if(569 + x * 42 + xx <> Points[f].X)or(228 + y * 36 + yy <> Points[f].Y)then begin Result:= True; Exit; end; yy:= yy + 1; if(yy = 16)then begin xx:= xx + 1; yy:= 0; end; end; end; function InvinCount:integer; var xx, yy, i: Integer; begin GameTab(4); for yy:= 0 to 6 do begin for xx:= 0 to 3 do begin if(ExistsItem(xx, yy))then i:= i+1 end; end; result:=i; end; function FindColorRight(var cx,cy:Integer; dacolor,ax1,ay1,ax2,ay2:Integer):Boolean; var a,b,c,d:Integer; x, y: Integer; begin a:=ax2-1; b:=ay1; c:=ax2; d:=ay2; repeat if(findcolor(x,y,dacolor,a,b,c,d))then result:=true; a:=a-1; c:=c-1; until(result)or(a<=ax1) if(result)then begin cx:= x; cy:= y; end; end; procedure DisguiseScar(disguise:string); var application:tapplication; Self: TForm; begin Application:= GetApplication; Application.Title:= disguise; Self:= GetSelf; Self.Caption:= disguise; end; //Trys to find one of the two objects specified searching from the center out, if //object is found it returns coords on cx, cy Function FindObjects(var cx, cy:Integer; objtext,objtext2,Breakif:string; objcolor,tol:integer):boolean; var a, b, c, d, x, y : Integer; begin a:=257; b:=168; c:=257; d:=168; if(FindColorTolerance(x,y,objcolor,1,1,514,336,tol))then repeat a:=a-10; b:=b-7; c:=c+10; d:=d+7; if(FindColorTolerance(x, y, objcolor, a, b, a+10, d, tol))then begin Mousec(x,y,0); Wait(200); if(IsTextUp(objtext)or IsTextUp(objtext2))then begin result:=true; Break; end; if(IsTextUp(Breakif))then begin result:=false; Break; end; end; if(FindColorTolerance(x, y, objcolor, a, d-7, c, d, tol))then begin Mousec(x,y,0); Wait(200); if(IsTextUp(objtext)or IsTextUp(objtext2))then begin result:=true; Break; end; if(IsTextUp(Breakif))then begin result:=false; Break; end; end; if(FindColorTolerance(x, y, objcolor, c-10, b, c, d,tol))then begin Mousec(x,y,0); Wait(200); if(IsTextUp(objtext)or IsTextUp(objtext2))then begin result:=true; Break; end; if(IsTextUp(Breakif))then begin result:=false; Break; end; end; if(FindColorTolerance(x, y,objcolor,a,b,c,b+7,tol))then begin Mousec(x,y,0); Wait(200); if(IsTextUp(objtext)or IsTextUp(objtext2))then begin result:=true; Break; end; if(IsTextUp(Breakif))then begin result:=false; Break; end; end; until(b<6) if(result)then begin cx:=x; cy:=y; end; end; function StopKey: Boolean; begin If(IsFunctionKeyDown(0)and IsFunctionKeyDown(1)) and IsKeyDown('q') Then result:= True end; function Hp: Integer; begin result:=GetStat('hp', true); end; function HpMax: Integer; begin result:=GetStat('hp', false); end; function HpLost: Integer; begin result:=HpMax-Hp; end; function effect : string; //returns a random effect var color,effecty:array[0..11] of string; begin color[1]:='red:' color[2]:='purple:' color[3]:='green:' color[4]:='white:' color[5]:='cyan:' color[6]:='flash1:' color[7]:='flash2:' color[8]:='flash3:' color[9]:='glow1:' color[0]:='glow2:' color[10]:='glow3:' color[11]:='' effecty[0]:='scroll:' effecty[1]:='shake:' effecty[2]:='slide:' effecty[3]:='wave:' effecty[4]:='wave2:' effecty[5]:='' result:=color[Random(12)]+effecty[random(6)]+' ' end; function RandomExclaimations ( times : integer ) : string; //returns a random amount of !!'s var i,times2:integer; begin i:=0 times2:=random(times) result:='' repeat result:=result+'!'; i:=i+1 until(i>=times2) end; function IsBoneTextUp : Boolean; //checks text for bury all types of bones begin if IsTextUp('Bury Bones')or IsTextUp('Bury Big Bones')or IsTextUp('Bury Baby Dragon Bones')or IsTextUp('Bury Dragon Bones')or IsTextUp('Bury Jogre Bones')or IsTextUp('Bury Zogre Bones')or IsTextUp('Bury Wolf Bones')or IsTextUp('Bury Monkey Bones')or IsTextUp('Bury Bat Bones')then result:=True end; function ClickOnText(Text:String; x1,y1,x2,y2:Integer):Boolean; var xy, yx: Integer; begin if(IsTextInAreaEx(x1,y1,x2,y2,xy,yx,Text,150,chrCharsNormal,False,True,0,1,-1))then begin Result:=True; MouseCR(xy+10+random(30),yx+3,2,1) end; Wait(200+random(100)) end; procedure RightClickText(Text:string; x,y,range:Integer); begin MouseCR(x,y,range,2) Wait(100+random(200)) ClickOnText(Text,G1,G2,G3,G4) end; procedure InvinXY(var x:Integer; var y:Integer; Invin:Integer); //Takes Inventory spot to figure out coordinants for x,y var row,col:Integer; begin row:=Trunc(invin div 4) col:=invin-(row*4)-1 if col<0 then begin col:=3 row:=row-1 end; x:=585+col*42 y:=230+row*36 end; procedure RowColXY(var x:Integer; var y:Integer; Row,Col:Integer); //Takes row and collum to figure out coordinants for x,y begin x:=585+(col-1)*42 y:=230+(row-1)*36 end; {-----------------------------------------------------------------------+ Moves mouse to specified inventory spot click: 0 dont click,1 left,2 right and click Text example for text: use,eat,drop,examine,store all,offer +-----------------------------------------------------------------------} procedure InvinMouseCRItem(invin,range,click:Integer; ItemUse:string); var x,y:Integer; begin GameTab(4); InvinXY(x,y,Invin) MouseCR(x,y,range,0) if(click>0) Then Case IsTextUp(ItemUse) Of True:MouseCR(x,y,range,1) False:RightClickText(ItemUse,x,y,range) End Wait(200+random(100)); end; procedure RowColMouseCRItem(Row,Col,range,click:Integer; ItemUse:string); //Same as above except it uses row and col var x,y:Integer; begin GameTab(4); RowColXY(x,y,Row,Col) MouseCR(x,y,range,0) if(click>0) Then Case IsTextUp(ItemUse) Of True:MouseCR(x,y,range,1) False:RightClickText(ItemUse,x,y,range) End Wait(200+random(100)); end; Procedure ClickUse(X,Y,Range:Integer;ObjectUse:String); //left click if ObjectUse text is up else right clicks and clicks the use begin MouseCR(x,y,Range,0) Case IsTextUp(ObjectUse) Of True:MouseCR(x,y,range,1) False:RightClickText(ObjectUse,x,y,range) End end; Function FindObjectsClick(ObjectText,ObjectText2,ObjectUse,Breakif:String; ObjColor,Tol,Click,Range:Integer):Boolean; var x,y:Integer; begin if FindObjects(x,y,ObjectText,ObjectText2,Breakif,ObjColor,tol) then begin case Click of 0:MouseCR(x,y,range,0) 1:ClickUse(x,y,Range,ObjectUse) 2:RightClickText(ObjectUse,x,y,range) end Result:=true end else result:=false end; Function FindObjectClick(ObjectText,ObjectUse,Breakif:String; ObjColor,Tol,Click,Range:Integer):Boolean; begin if FindObjectsClick(ObjectText,ObjectText,ObjectUse,Breakif,ObjColor,Tol,Click,Range) then result:=true; end; function GetTextUp:string; begin result:= GetTextAtEx(9,9,130,chrCharsNormal,True,False,0,1,-1,40,False,tr_AlphaNumericChars); end; Procedure ListItems; Var Item:Integer; begin Item:=1 repeat InvinMouseCRItem(Item,5,0,'') ItemsNamesInvin[Item]:=GetTextAtEx(9,9,130,chrCharsNormal,True,False,0,1,3899100,55,False,tr_AlphaNumericChars) Item:=Item+1 until(Item>=29) end;