PDA

View Full Version : HELP: Auto-restock Script


synikal
23rd January 2006, 15:53
I tried using one of the prewritten scripts as a guideline for this one. The script escapes the character from an area near Ivory Tower to Oren Castle Town and is supposed to automatically refill on CSS, potions etc. then teleport back to the tower and continue combat. For some reason as I run the script it doesnt work ><! If any expert scripters can take a look I'd really appreciate it. :bunny:


Label(Check)

DELAY(100)
POSINRANGE(82123,53535,-1488,1000)//Checks if in Town (NE Part)
{
Call(InTownNEast)
}

DELAY(100)
POSINRANGE(828285,55855,-1520,1200)//Checks if in Town (SE Part)
{
Call(InTownSEast)
}

DELAY(100)
POSINRANGE(80054,53209,-1552,1000)//Checks if in Town (NW Part)
{
Call(InTownNWest)
}

DELAY(100)
POSINRANGE(80367,56246,-1536,1000)//Checks if in Town (SW Part)
{
Call(InTownSWest)
}

DELAY(100)
ITEMCOUNT(Soulshot: C-Grade[ID=1464],<,100)
{
Call(ToTown)
}

DELAY(100)
ITEMCOUNT(Scroll of Escape[ID=736],<,3)
{
Call(ToTown)
}

DELAY(100)
ITEMCOUNT(Haste Potion[ID=734],<,3)
{
Call(ToTown)
}

DELAY(100)
ITEMCOUNT(Healing Potion[ID=1061],<,11)
{
Call(ToTown)
}

DELAY(100)
ITEMCOUNT(Potion of Alacrity[ID=735],<,3)
{
Call(ToTown)
}

DELAY(5000)
Call(Check)


///////////////////////////////////////////////////////////////////////
// //
// Go To Town //
// //
// //


Label(ToTown)
CharStatus(HP,=,100)
{
SET(FIGHTSTOP)
UseItem(Scroll of Escape[ID=736])
DELAY(20000)
DELAY(100)
POSOUTRANGE(81125,54973,-1520,3200)//Checks if in Town
{
Call(ToTown)
}
Call(BuyItems)
}
SET(FIGHTSTART)
Call(ToTown)

Label(BuyItems)

PosOutRange(81125,54973,-1520,3200)
{
Call(ToTown)
}


//////////////////////////////IN/////////////////////////////////////////

LABEL(InTownNEast)
POSINRANGE(82123,53535,-1488,1000)//Checks if in Town (NE Part)
{
MOVETO(82408,540505,-1488)//Start
MOVETO(82351,55556,-1488)
MOVETO(80907,55556,-1520)
}

LABEL(InTownSEast)
POSINRANGE(828285,55855,-1520,1200)//Checks if in Town (SE Part)
{
MOVETO(82351,55556,-1488)
MOVETO(80907,55556,-1520)
}

LABEL(InTownNWest)
POSINRANGE(80054,53209,-1552,1000)//Checks if in Town (NW Part)
{
MOVETO(80304,56241,-1552)
}

LABEL(InTownSWest)
POSINRANGE(80367,56246,-1536,1000)//Checks if in Town (SW Part)
{
MOVETO(80304,56241,-1552)
}

MOVETO(80838,54985,-1520)//Center
//////////////////////////////Out///////////////////////////////////////



///////////////////////////////////////////////////////////////////////
// //
// Enter Warehouse //
// //
// //




ITEMCOUNT(Soulshot: C-Grade[ID=1464],<,100)
{
CALL(GoToWH)
}

CALL(DontGoToWH)

Label(GoToWH)
////////////////////////////In//////////////////////////////////////////
MOVETO(80838,54985,-1520)//Center: To WH keeper Hagger
MOVETO(81125,54973,-1520)
MOVETO(81400,54708,-1504)
MOVETO(81756,55121,-1504)//Beside WH Keeper Hagger
////////////////////////////Out/////////////////////////////////////////

POSINRANGE(81756,55121,-1504,40)
{
NPCSEL(Hagger)
DELAY(1000)

Label(Itemtake)
NPCDLG(Hagger)
DELAY (1000)
DLGSEL(Withdraw Item)
DELAY(1000)
}


ITEMCOUNT(Soulshot: C-Grade[ID=1464],<,100)
{
LoadItem(Soulshot: C-Grade[ID=1464],10000)
CALL(Itemtake)
MSG(Withdrew CSS)
}

/////////////////////////////IN//////////////////////////////////////////
MOVETO(81756,55121,-1504)
MOVETO(81400,54708,-1504)
MOVETO(81125,54973,-1520)
MOVETO(80838,54985,-1520)//Center
/////////////////////////////Out////////////////////////////////////////

Label(DontGoToWH)

// //
// Exit Warehouse //
///////////////////////////////////////////////////////////////////////


///////////////////////////////////////////////////////////////////////
// //
// Magic Shop //
// //
// //

ITEMCOUNT(Scroll of Escape[ID=736],<,3)
{
Call(GoToMagicShop)
}
ITEMCOUNT(Healing Potion[ID=1061],<,11)
{
Call(GoToMagicShop)
}
ITEMCOUNT(Haste Potion[ID=734],<,3)
{
Call(GoToMagicShop)
}
ITEMCOUNT(Potion of Alacrity[ID=735],<,3)
{
Call(GoToMagicShop)
}

Call(GoBack)

LABEL(GoToMagicShop)
/////////////////////////////IN//////////////////////////////////////////
MOVETO(80262,54858,-1544)
MOVETO(79914,54924,-1544)
MOVETO(79656,55074,-1544)
MOVETO(79522,54975,-1544)/Trader Sara
/////////////////////////////Out////////////////////////////////////////
POSINRANGE(79522,54975,z,90)
{
/////////////////////////////Buy/////////////////////////////////////

Label(BuyMagicShop)
NPCSEL(Sara)
DELAY(1000)
NPCDLG(Sara)
DELAY (1000)
DLGSEL(Buy)
DELAY(1000)

//SOE
ITEMCOUNT(Scroll of Escape[ID=736],<,3)
{
BuyItem(Scroll of Escape[ID=736],1)
MSG(Bought SOE)
CALL(BuyMagicShop)
}

//Healing Pots
ITEMCOUNT(Healing Potion[ID=1061],<,11)
{
BuyItem(Healing Potion[ID=1061],400)
MSG(Bought Healing Potion)
CALL(BuyMagicShop)
}

//Haste Pots
ITEMCOUNT(Haste Potion[ID=734],<,3)
{
BuyItem(Haste Potion[ID=1060],30)
MSG(Bought Haste Potion)
CALL(BuyMagicShop)
}

//Alacrity Pots
ITEMCOUNT(Potion of Alacrity[ID=735],<,3)
{
BuyItem(Potion of Alacrity[ID=735],30)
MSG(Bought Potion of Alacrity)
CALL(BuyMagicShop)
}

////////////////////////////////IN///////////////////////////////////////

MOVETO(79656,55074,-1544)
MOVETO(79914,54924,-1544)
MOVETO(80262,54858,-1544)
MOVETO(80838,54985,-1520)//Center
////////////////////////////////Out/////////////////////////////////////
}

// //
// Exit Magic Shop //
///////////////////////////////////////////////////////////////////////


///////////////////////////////////////////////////////////////////////
// //
// Back To Fight //
// //


Label(GoBack)

////////////////////////////////IN///////////////////////////////////////
MOVETO(81148,53513,-1552)
MOVETO(82978,53181,-1488)//Beside GK
////////////////////////////////Out/////////////////////////////////////
}
POSINRANGE(82978,53181,z,30)
{
NPCSEL(Valentina)
DELAY(1000)
NPCDLG(Valentina)
DELAY (1000)
DLGSEL(Quest)
DELAY(1000)
StrNotInDlg(Say you will help)
{
Call(ValenPort)
}

DELAY (1000)
DLGSEL(Say you will help)
DELAY (1000)

Label(ValenPort)
NPCDLG(Valentina)
DELAY (1000)
DLGSEL(Teleport)
DELAY(1000)
DLGSEL(Ivory Tower)
DELAY(20000)

DELAY(100)
POSINRANGE(82123,53535,-1488,1000)//Checks if in Town (NE Part)
{
Call(InTownNEast)
}

DELAY(100)
POSINRANGE(828285,55855,-1520,1200)//Checks if in Town (SE Part)
{
Call(InTownSEast)
}

DELAY(100)
POSINRANGE(80054,53209,-1552,1000)//Checks if in Town (NW Part)
{
Call(InTownNWest)
}

DELAY(100)
POSINRANGE(80367,56246,-1536,1000)//Checks if in Town (SW Part)
{
Call(InTownSWest)
}


/////////////////////////////////IN////////////////////////////////////
//START PATH BACK TO FIGHT SCENE
MOVETO(85382,24910,-3632)
MOVETO(86138,24874,-3648)
//////////////////////////////////Out//////////////////////////////////
SET(FIGHTSTART)