Author Topic: quest HeartWood Bowcraft  (Read 8449 times)

0 Members and 1 Guest are viewing this topic.

Offline ShinmaTopic starter

  • Newbie
  • *
  • Posts: 7
  • Activity:
    0%
  • Reputation Power: 1
  • Shinma has no influence.
  • Gender: Male
  • Respect: 0
  • Referrals: 0
    • View Profile
quest HeartWood Bowcraft
« on: October 13, 2013, 01:27:26 AM »
0
Code: [Select]
Program questHeartWoodBowcraft;
//Autor : Shinma
//Clear all quest!!!!
//Skill BC mast be 100
//Char mast have GiantBeetle with clear pack
//Char mast have 2-5 tinkertools,2-5 fletching
//Char mast have 0-ZERO boards and ingot, All material must be in bank in BugInBank
//Char autocraft fletching, tinkertools. He mast Have skill Tinkering for that.
//this scipt not sort item.
//test on RunUO
//Bank at the center Heartwood
const
QuestNPC1=$00016062 ;   //Enter ID
GiantBeetle=$0006B91A ; //Enter ID
BankX=7035;             //Bank in Heartwood
BankY=409;              //Bank in Heartwood
BugInBank =$400F2468 ;  //Enter ID Bag In Bank with board
QuestX= 7048;           //coord where do it quest(1 tail with trash barrel)
QuestY= 378;            //coord where do it quest
TrashBarrel=$0E77 ;
fletching=$1022 ;
TinkerTool=$1EB8 ;
ingot=$1BF2 ;
boards=$1BD7 ;
Bows=$13B2;        
Crossbows=$0F50;  
HeavyCrossbows=$13FD ;
RepeatingCrossbows=$26C3;  
GumpAc=$E5DC;
GumpOk=$0320;


var
agump,i,j,n:integer;
QuestNPC : array of Cardinal;
QuestName : array of string;

procedure Init;
begin
AddToSystemJournal('Init') ;
QuestNPC:=[QuestNPC1];
SetPauseScriptOnDisconnectStatus(True);
SetARStatus(True);
FindDistance:=20;
if not Connected then
    begin
    Connect;
    wait(5000);
    end;
end;

procedure CloseGamp;
var
g:integer;
begin
AddToSystemJournal('CloseGamp') ;
    for g:=0 to  GetGumpsCount-1 do
        begin      
        if (GetGumpID(g) = $0326)  then
            begin  
                NumGumpButton(g,5);
                wait(500);  
                 NumGumpButton(g,0);
              //  AddToSystemJournal('ok') ;
            end;
        if (GetGumpID(g) = $FF3D ) or (GetGumpID(g) = $0320 )  then  
            begin
                NumGumpButton(g,7);  
                NumGumpButton(g,5);
                 //AddToSystemJournal('Брать квест') ;
                 wait(500);
            end
            else
           //  AddToSystemJournal('не дали квест') ;
        if (GetGumpID(g) = $E5DC) or (GetGumpID(g) =  $FF93) then  
            begin
            NumGumpButton(g,7);
            NumGumpButton(g,5);                  
          //  AddToSystemJournal('Check') ;
            end;
        //else  
          //  AddToSystemJournal('No Check') ;
        end;
        wait(500);  
        for g:=0 to  GetGumpsCount-1 do
        CloseSimpleGump(g);
end;

Procedure CheckTinkerTools;
begin
checklag(50000);
AddToSystemJournal('CheckTinkerTools') ;
while (count(TinkerTool) <2) and (count(ingot) >2) do
  begin  
  for i:=0 to  GetGumpsCount do
  begin      
  wait(500);
  CloseSimpleGump(i);
  end;
  agump := GetGumpsCount;
  checklag(50000);
  UseObject(FindType(TinkerTool,Backpack));
    wait(1000);
    while agump = GetGumpsCount do
    Wait(60);    
    NumGumpButton(GetGumpsCount-1,9002);
    wait(600);
    NumGumpButton(GetGumpsCount-1,11);
    AddToSystemJournal('Craft TinkerTool');
    wait(5000);
  end;
end;

Procedure Checkfletching;
begin
checklag(50000);
AddToSystemJournal('Checkfletching') ;
while (count(fletching) <5) and (count(ingot) >3) do
  begin  
  for i:=0 to  GetGumpsCount do
  begin      
  wait(500);
  CloseSimpleGump(i);
  end;
  agump := GetGumpsCount;
  checklag(50000);
  CheckTinkerTools;
  UseObject(FindType(TinkerTool,Backpack));
    wait(1000);
    while agump = GetGumpsCount do
    Wait(60);    
    NumGumpButton(GetGumpsCount-1,9002);
    wait(600);
    NumGumpButton(GetGumpsCount-1,28);
    AddToSystemJournal('craft fletching');
    wait(5000);
  end;
end;

procedure checkboards;
var
ZukBugBoard: Cardinal;
begin
AddToSystemJournal('checkboards') ;
if (Count(boards) < 100) then
  begin
  if ObjAtLayer(HorseLayer) > 0 then
    begin
    UseObject(Self);
    checklag(50000);
    wait(500);
    RequestContextMenu(GiantBeetle);
    SetContextMenuHook(GiantBeetle, 10);
    wait(500);
    checklag(50000);
    ZukBugBoard := FindType(boards, LastContainer);
    if GetQuantity(ZukBugBoard) >= 100 then
        begin
        MoveItem(ZukBugBoard, count(boards), Backpack(), 0, 0, 0);  
        wait(2000);
        checklag(50000);
        if ObjAtLayer(HorseLayer) = 0 then
                begin
               // newmovexy(getX(GiantBeetle),gety(GiantBeetle),true,1,true);
                checklag(50000);
                UseObject(GiantBeetle);
                wait(2000);
                end;    
        end
    else
        begin  
        while ObjAtLayer(HorseLayer) = 0 do
            begin
            newmovexy(getX(GiantBeetle),gety(GiantBeetle),true,1,true);
            checklag(50000);
            UseObject(GiantBeetle);
            wait(500);
            end;
        newmovexy(BankX,BankY,true,1,true);  
       // while not dead and (ObjAtLayer(BankLayer) = 0) do
       //     begin
            checklag(60000);
            uosay('bank');  
            wait(2000);
       //     end;  
        UseObject(BugInBank);
        checklag(60000);
        wait(2000);
        FindType(boards, BugInBank);
        checklag(60000);
        MoveItem(FindItem,2500,backpack,0,0,0);
        wait(2000);
        if count(ingot) < 50 then
          begin      
          UseObject(BugInBank);
          checklag(60000);
          wait(2000);
          FindType(ingot, BugInBank);
          checklag(60000);
          MoveItem(FindItem,80,backpack,0,0,0);
          wait(2000);
          end;
          if ObjAtLayer(HorseLayer) > 0 then
            begin
            checklag(50000);
            UseObject(Self);
            checklag(50000);
            wait(2000);
            RequestContextMenu(GiantBeetle);
            SetContextMenuHook(GiantBeetle, 10);
            wait(2000);
            checklag(50000);
            MoveItem(FindType(boards, backpack), count(boards), LastContainer, 0, 0, 0);  
            wait(2000);
            checklag(50000);                  
            end;  
            if ObjAtLayer(HorseLayer) = 0 then
                begin
               // newmovexy(getX(GiantBeetle),gety(GiantBeetle),true,1,true);
                checklag(50000);
                UseObject(GiantBeetle);
                wait(2000);
                end;
        newmovexy(QuestX,QuestY,true,1,true);
        end;
    end;
  end;  
end;

procedure create(BtRz,BtIt,kolvoboards,kolvoItem:integer;TpItem:word);
var
aa : TClilocRec;  
bb : TClilocItemRec;
OldSkill : Double;
checkW,ddd:integer;
begin
AddToSystemJournal('create') ;
IgnoreReset;
aa := GetToolTipRec(backpack);
bb := aa.Items[1];

while  (count(fletching)>0) and (strtoint(bb.Params[0])<124)  and not dead and (count(boards)>=kolvoboards) and (count(TpItem) < kolvoItem) do
  begin
  for i:=0 to  GetGumpsCount do
    begin      
    wait(500);
    CloseSimpleGump(i);
    end;
    agump := GetGumpsCount;
    checklag(50000);  
    CheckTinkerTools;
    Checkfletching;
    UseObject(FindType(fletching,Backpack));
    wait(1000);
    while agump = GetGumpsCount do
    Wait(60);    
    NumGumpButton(GetGumpsCount-1,BtRz);
    wait(600);
    NumGumpButton(GetGumpsCount-1,BtIt);
    AddToSystemJournal('Create Item');
    wait(1000);    
    checkW:=0;  
    //AddToSystemJournal('111 count(TpItem)='+inttostr(count(TpItem)));
    while not dead and connected and (strtoint(bb.Params[0])<124) and IsObjectExists(FindItem) and (count(boards)>=kolvoboards) and (count(fletching) > 0) and (count(TpItem) < kolvoItem) and (checkW < 11)do  
    begin  
      checklag(50000);
      WaitGump('1999');
      Wait(1500);
      aa := GetToolTipRec(backpack);
      bb := aa.Items[1];
      checkW:=checkW+1;
      //AddToSystemJournal('222 count(TpItem)='+inttostr(count(TpItem)));        
    end;  
    CloseGamp;
    aa := GetToolTipRec(backpack);
    bb := aa.Items[1];
  end  ;
end;


function CheckName ( ItemName, CheckString : String) : Boolean;
begin
result:=BMSearch(1,LowerCase(ItemName),LowerCase(CheckString)) >0;
end;

Procedure QuestReq;
var gi : TGumpInfo;
    i : Integer;
begin
AddToSystemJournal('QuestReq') ;
SetLength(QuestName,0);
checklag(60000);
QuestRequest;
wait(1000);
GetGumpInfo(GetGumpsCount-1, gi);
AddToSystemJournal('Gump has ' + IntToStr(Length(gi.XmfHTMLGumpColor)) + ' XmfHTMLGumpColors');
if Length(gi.XmfHTMLGumpColor) > 0 then
for i := 1 to (Length(gi.XmfHTMLGumpColor)-1) do
    begin
    
    SetLength(QuestName,Length(QuestName) +1 );
QuestName[Length(QuestName)-1]:=GetClilocByID(gi.XmfHTMLGumpColor[i].Cliloc_id);
    end;
    for i:=0 to (Length(QuestName)-1) do
  AddToSystemJournal('QuestName=' + QuestName[i]);
  NumGumpButton(GetGumpsCount-1,0);
end;

procedure MarkItem(ItType:word;kolvoItem:integer);
var
p:integer;
begin
AddToSystemJournal('MarkItem') ;
p:=0;
n:=0;
CloseGamp;
//findtype(ItType,backpack);
AddToSystemJournal('(count(ItType)='+inttostr(count(ItType))+' Name='+GetName(findtype(ItType,backpack))+' Hex='+inttohex(ItType,4));

if (count(ItType) >= kolvoItem) then
 while not dead and (p < kolvoItem)   do    
    begin
    findtype(ItType,backpack);
    if  GetColor(finditem)=$0000 then
        begin      
        WaitTargetObject (finditem);    
        checklag(60000);
        RequestContextMenu(Self);
        SetContextMenuHook(Self, 5) ;
        wait(500);        
        end;
    Ignore (finditem);
    p:=p+1;  
    AddToSystemJournal('p='+inttostr(p));
    n:=1;
    wait(100);    
    end;  
    IgnoreReset;  
    if  TargetPresent then CancelTarget;
end;

procedure QuestEnd;
var
a:integer;
//gi : TGumpInfo;
begin
AddToSystemJournal('QuestEnd') ;
   // for i:= 0 to (Length(QuestNPC)-1) do
   if n = 1 then
    begin
    //WaitGump('5');  
CloseGamp;
    a:=GetGumpsCount;
    checklag(60000);
    UseObject(QuestNPC[j]);
    while a =  GetGumpsCount do wait(50);
   // GetGumpInfo(GetGumpsCount-1, gi);
    if GetGumpID(GetGumpsCount-1) = GumpOk  then  
    begin
    NumGumpButton(GetGumpsCount-1,5);        
   // AddToSystemJournal('Check');  
    SetLength(QuestName,0);
    end;
CloseGamp;
    end;  
    wait(500);
end;

Procedure QuestCheck;
begin
AddToSystemJournal('QuestCheck') ;

for j:=0 to (Length(QuestName)-1) do
    begin        
    AddToSystemJournal('QuestName[i] = ' +QuestName[j]);
    if CheckName(QuestName[j],'Ingenious')then  
    if length(QuestName[j])=27 then
        begin
        //RepeatingCrossbows=$26C3; 10 шт  
        AddToSystemJournal('Ingenious Archery, Part III');  
        AddToSystemJournal('create RepeatingCrossbows');
        create(9003,10,10,10,RepeatingCrossbows);
        MarkItem(RepeatingCrossbows,10);
        QuestEnd;
        end;  
        if CheckName(QuestName[j],'Ingenious') then
        if length(QuestName[j])=26 then
        begin
        //HeavyCrossbows=$13FD ;  8 шт  
        AddToSystemJournal('Ingenious Archery, Part II');
        AddToSystemJournal('create HeavyCrossbows');
        create(9003,8,10,8,HeavyCrossbows);  
        MarkItem(HeavyCrossbows,8);
        QuestEnd;
        end;            
    if CheckName(QuestName[j],'Ingenious') then
    if length(QuestName[j])=25 then
    //if BMSearch(24,'Part I',QuestName[i]) >0
        begin
        //Crossbows=$0F50; 10 шт
        AddToSystemJournal('Ingenious Archery, Part I');  
        AddToSystemJournal('create Crossbows');
        create(9003,7,7,10,Crossbows);
        MarkItem(Crossbows,10);
        QuestEnd;                      
        end;
    if CheckName(QuestName[j],'A Simple Bow')    then
        begin
        //???     Bows    7шт
        AddToSystemJournal('A Simple Bow');  
        AddToSystemJournal('create Bows');
        create(9003,6,7,10,Bows);
        MarkItem(Bows,10);
        QuestEnd;
        end;
    end;
end;

procedure GimeMeQuest;
var
kk,a:integer;
begin
AddToSystemJournal('GimeMeQuest') ;
  AddToSystemJournal('Length(QuestNPC)='+inttostr(Length(QuestNPC)));
    for kk:=0 to (Length(QuestNPC)-1) do
        begin
        checklag(60000);
        AddToSystemJournal('i='+inttostr(kk));
        AddToSystemJournal('name='+GetName(QuestNPC[kk]));
        UseObject(QuestNPC[kk]);
        a:=GetGumpsCount;
        checklag(60000);
        UseObject(QuestNPC[kk]);
        wait(500);
        checklag(60000);
        CloseGamp;  
        end;    
        AddToSystemJournal('name end');
end;
begin
checklag(60000);
Init;
checklag(60000);
CloseGamp;
checklag(60000);
while not dead do
    begin  
    checkboards;
    CheckTinkerTools;
    Checkfletching;
    checklag(60000);
    GimeMeQuest;
    QuestReq;
    QuestCheck;
    end;
end.
« Last Edit: October 13, 2013, 01:52:40 AM by Shinma »

Offline Chops

  • Jr. Member
  • **
  • Posts: 75
  • Activity:
    0%
  • Reputation Power: 1
  • Chops has no influence.
  • Respect: +16
  • Referrals: 0
    • View Profile
Re: quest HeartWood Bowcraft
« Reply #1 on: October 13, 2013, 02:30:27 AM »
0
Is this for a freeshard?

Offline ShinmaTopic starter

  • Newbie
  • *
  • Posts: 7
  • Activity:
    0%
  • Reputation Power: 1
  • Shinma has no influence.
  • Gender: Male
  • Respect: 0
  • Referrals: 0
    • View Profile
Re: quest HeartWood Bowcraft
« Reply #2 on: October 13, 2013, 03:16:13 AM »
0
its example full work scripts. all answer in comment script. I want to set an example for other developments in this direction. I never write scripts where players do not have to think a little bit before he starts it. I think every player has to think about the script before using it.

Offline dxrom

  • Master of the milestones!
  • Elite
  • *
  • *
  • Posts: 1080
  • Activity:
    0%
  • Reputation Power: 15
  • dxrom is working their way up.dxrom is working their way up.dxrom is working their way up.
  • KEYBOARD COWBOY, GREAT SAMURAI OF THE INTERNET.
  • Respect: +277
  • Referrals: 1
    • View Profile
Re: quest HeartWood Bowcraft
« Reply #3 on: October 13, 2013, 04:59:38 AM »
0
Is this for a freeshard?

Yeah, this is for freeserver.

Code: [Select]
//test on RunUO
//Bank at the center Heartwood
BankX=7035;             //Bank in Heartwood
BankY=409;              //Bank in Heartwood

:P



 ​_██​_
(ಠ​_ృ)
I do say, ol' Chap! Come play EVE Online! Why here is a 21 Day Free Trial!

Offline ShinmaTopic starter

  • Newbie
  • *
  • Posts: 7
  • Activity:
    0%
  • Reputation Power: 1
  • Shinma has no influence.
  • Gender: Male
  • Respect: 0
  • Referrals: 0
    • View Profile
Re: quest HeartWood Bowcraft
« Reply #4 on: October 13, 2013, 06:21:21 AM »
0
if someone is not, he thinks, and adds a couple of lines NewMove and  waitgump
« Last Edit: October 13, 2013, 06:55:39 AM by Shinma »

Offline Orich

  • Jr. Member
  • **
  • Posts: 77
  • Activity:
    0%
  • Reputation Power: 3
  • Orich has no influence.
  • Respect: +27
  • Referrals: 1
    • View Profile
Re: quest HeartWood Bowcraft
« Reply #5 on: October 13, 2013, 05:04:25 PM »
0
Very nice :)
Member of the Stealth development team.
Author of Stealth .NET DLL

Tags: