[CD3.55] take all script

dagras

LOMCN Veteran
Veteran
Feb 6, 2011
282
3
44
sorry if this been posted elsewhere- i been trying to get script working for this all day and head done in lol.what im trying to do is make a script for npc that checks how many olds, rusts,antiques and ironpieces u have in bag and gives u the option of changing them all at same time for fp.would anyone be so kind enough to give a basic script for this that i can make suitable for my server please?tyvm in advance for your time.
 

XxEvilDxX

Banned
Banned
Dedicated Member
Apr 10, 2010
158
15
85
USA
sorry if this been posted elsewhere- i been trying to get script working for this all day and head done in lol.what im trying to do is make a script for npc that checks how many olds, rusts,antiques and ironpieces u have in bag and gives u the option of changing them all at same time for fp.would anyone be so kind enough to give a basic script for this that i can make suitable for my server please?tyvm in advance for your time.

It has been a while since I wrote a script but I am pretty sure it would something like the following
This would go inside a NPC script...

#IF
CHECKITEM olds 10
CHECKITEM rusts 5
CHECKITEM antiques 3
CHECKITEM ironpieces 50

#ACT
TAKE olds 10
TAKE rusts 5
TAKE antiques 3
TAKE ironpieces 50
GIVE QuestItem 1

#ELSESAY
Sorry... you do not have the required items
 
Upvote 0

dagras

LOMCN Veteran
Veteran
Feb 6, 2011
282
3
44
im not wanting it to check for 5 or 10 items for example if u have 17 ironpieces, 9 soulrulerring(old) 2dragonhelmet(rust), that it tells u what u got and asks if u want to trade for fp then it takes the ip's for 200fp each, olds for 300fp each and rusts for 500fp each, rather than do one at a time which can be tediouse at times
 
Upvote 0

XxEvilDxX

Banned
Banned
Dedicated Member
Apr 10, 2010
158
15
85
USA
im not wanting it to check for 5 or 10 items for example if u have 17 ironpieces, 9 soulrulerring(old) 2dragonhelmet(rust), that it tells u what u got and asks if u want to trade for fp then it takes the ip's for 200fp each, olds for 300fp each and rusts for 500fp each, rather than do one at a time which can be tediouse at times

You will have to be more specific about what you want. I think either way you will still have to check for the item first with a #IF before it then #ACT and take the item.
As far as the fame points go I never personally used them but here is a link that maybe helpful.
Also for more scripting information try typing the keyword script in the search. SCRIPTING HELP
 
Upvote 0

Geordiehc

Mad Dog Geo
VIP
Jul 4, 2007
2,827
49
195
Redditch, UK
Yes Evil is right, you must have a specific number... to make it easy you can use increments, so

Exchange Fragments:
Fragments x1
Fragments x5
Fragments x10
Fragments x50

That way if you have say 17 fragments, its literlly 4 clicks.

But yeah unfortunately the system cant see how many you have, it can only ask you, have you got 1 or 2 etc
 
Upvote 0

Cricket1650

Dedicated Member
Dedicated Member
Apr 25, 2008
66
0
52
Couldn't you just make some sort of loop that keeps increasing a variable? I'm no pro at scripting and I can't test it but this is how I'd picture it being. I don't know how memory intensive this would be but I suppose it's worth a test.

Code:
[@main]
#IF
CHECKTIEM Fragments 1
#ACT
MOV D0 2
Goto @loop

[@loop]
#IF
CHECKITEM Fragments %D0
#ACT
INC D0 1
Goto @loop
#ELSEACT
DEC D0 1
TAKE Fragments %D0
Give WHATEVERYOUWANTHERE 1
#ELSESAY
You win\
<exit/@exit>

If that doesn't work I believe you could always just do something like this
Code:
[@main]
#SAY
What do you wish to do?\
<Turn in quest items/@turn>\
<Exit/@exit>

[@turn]
#SAY
Please input how many Fragments you have.\
<Go/@turn2>
<Exit/@exit>

[@turn2]
#ACT
MOV D1 %INPUTSTR
Goto turn3

[@turn3]
#IF
CHECKITEM Fragments %D1
#ACT
MUL D1 5 ;;Gives 5 of whatever item you choose per Fragment they have.
TAKE Fragments %D1
GIVE CoolStuff %D1
#SAY
Here you are kind sir.\
<Exit/@exit>
#ELSESAY
You liar!\
<I am ashamed/@exit>
Again I'm not sure on the precision of this or if it's even what you want but it might be worth a shot.
 
Upvote 0

dagras

LOMCN Veteran
Veteran
Feb 6, 2011
282
3
44
couldnt make a script to take all items of same, so what i done was make it take 5 and 10 items of same at once.
would like to share for future developement.

;;不要删掉此行

[@main]
#SAY
{FCOLOR/1}Hello,I Take All Olds,Rusts And Ip's And{FCOLOR/1}\
{FCOLOR/1}exchange them to Fp plates .{FCOLOR/1}\
{FCOLOR/1}What can I do You For?{FCOLOR/1}\
<Use your service/@service>\
<Nothing, I will Come Back/@exit>\\


[@service]
#say
I Will Only Trade 5 Or 10 Items Of Same.\
Please choose which material to trade......\

<Fp IronPieces/@IronPiece>\
<FP Rusts/@RUSTS>\
<FP Old's/@OLDS>\
#ELSESAY
come back again when you are ready.\
<END/@Exit>\\

[@Ironpiece]
#SAY
{FCOLOR/1}WHICH IRONPIECE DO U WANT TO TRADE?{FCOLOR/1}\
{FCOLOR/1}BEAR IN MIND I trade 10 Of The Same at any One time.{FCOLOR/1}\
{FCOLOR/1}no more, no less!!!{FCOLOR/1}\
<SACER/@SACER>\
<FULMEN/@FULMEN>\
<NONE/@NONE>\
<GELU/@GELU>\
<ATER/@ATER>\
<INGIS/@INGIS>\
<PHASMA/@PHASMA>\
<VENTUS/@VENTUS>\
<RETURN TO MAIN MENU/@MAIN>\
<END/@Exit>\\

[@SACER]
#say
#IF
checkitem IronPiece(sacer) 10
#ACT
take IronPiece(sacer) 10
give FPPlate(1k) 2
#SAY
congrats u have traded 2kfp worth of ironpieces\
<end/@exit>\\
#ELSEACT
goto @noitem

[@FULMEN]
#say
#IF
checkitem IronPiece(fulmen) 10
#ACT
take IronPiece(fulmen) 10
give Fpplate(1k) 2
#SAY
congrats u have traded 2kfp worth of ironpieces\
<end/@exit>\\
#ELSEACT
goto @noitem

can do this for most items that are in game.
 
Upvote 0