Start script talking to NPC:
See Menu and already a textbox is shown.
Get another Menu with textbox.
I used TMC ideas from here (link:http://www.slimesalad.com/forum/viewtop ... c&start=25)
and Bob's explainations on string sprintf (link:http://www.slimesalad.com/forum/viewtopic.php?t=7142) show to what item was created.
Also, I added a suspend player to prevent the player from running away from the workbench (here it's still just an NPC) while crafting.
It seems that from time to time the menu shows there is already a text box behind it, saysing something was created. I am not 100% sure why or then it is happening. I think it happens the first time the script is run.
Could it be that the carfting script is triggered twice?
Are there some variables messing with eachother? Did I just overlook a bug?
Once again, I'm asking for help. xD
I'll post the whole script here:
Code: Select all
# Thanks to Bob the Hamster
#http://www.slimesalad.com/forum/viewtopic.php?t=7142
script, get_item, itemid, begin
$0="You created SOMETHING COOL."
string sprintf(0, $1="You created: %s", get item name(1, itemid))
get item (itemid)
show textbox (230)
wait for textbox
end
# script made by TCM (http://www.slimesalad.com/forum/viewtopic.php?p=125787#125787)
# name is a string id, whichscript is a script id
script, add craft recipe, name, which script, begin
open menu(20)
variable(mitem)
mitem := add menu item(top menu)
set menu item type(mitem, menutype:script)
set menu item subtype(mitem, which script)
set menu item caption(mitem, name)
set menu item bit(mitem, menu item bit:close menu when selected, on)
end
((lot's of recipe go here))
script,craft_charm_dog,begin
delete item(77)
delete item(16)
delete item(43)
get_item(95)
end
plotscript, carfting, begin
# TODO: StringNumbers: sort this so player gets a nice list
#QUEST ITEMS
if (inventory(11) && inventory(79) && inventory(45)) then (add craft recipe($0="Vial of Invisibility", @craft_invisibility_vial))
# AMULETTS
if (inventory (57) && inventory (28) && inventory(42)) then (add craft recipe($1="Amulett of Fire", @craft_amulett_of_fire))
if (inventory (28) && inventory (42) && inventory(65)) then (add craft recipe($2="Amulett of Ice", @craft_amulett_of_ice))
if (inventory (item:Stone) && inventory (item:Thread) && inventory(46)) then (add craft recipe($3="Amulett of Air", @craft_amulett_of_air))
if (inventory (69) && inventory(90) && inventory(42)) then (add craft recipe($4="Amulett of Light", @craft_amulett_of_light))
if (inventory(54) && inventory(90) && inventory(42)) then (add craft recipe($5="Amulett of Darkness", @craft_amulett_of_darkness))
if (inventory(66) && inventory(90) && inventory(42)) then (add craft recipe($6="Amulett of Illusion", @craft_amulett_of_illusion))
if (inventory (78) && inventory (42) && inventory(103) && inventory(60)) then (add craft recipe($7="Amulett of Water", @craft_amulett_of_water))
if (inventory (56) && inventory (78) && inventory(42) && inventory(60)) then (add craft recipe($8="Amulett of Earth", @craft_amulett_of_earth))
if (inventory (42) && inventory(78) && inventory(80) && inventory(60)) then (add craft recipe($9="Amulett of Plants", @craft_amulett_of_plants))
if (inventory (78) && inventory (89) && inventory(42)) then (add craft recipe($10="Amulett of Regeneration", @craft_amulett_of_regeneration))
# POTIONS
if (inventory(69) && inventory (44) && inventory (67)) then (add craft recipe($11="Potion (500)", @craft_potion500))
if (inventory(16) && inventory (112) && inventory (69)) then ( add craft recipe($12="Potion (200)", @craft_potion200))
if (inventory(111) && inventory(69) && inventory(31)) then ( add craft recipe($13="Potion (100)", @craft_potion100))
if (inventory(69) && inventory (43) && inventory (111)) then ( add craft recipe($14="Potion (50)", @craft_potion50))
if (inventory(69) && inventory (91) && inventory (43)) then (add craft recipe($15="Potion (20)", @craft_potion20))
# MP POTION
if (inventory(91) && inventory (43)) then (add craft recipe($16="MedMP (10)", @craft_MP_potion10))
if (inventory(43) && inventory (111)) then (add craft recipe($17="MedMP (15)", @craft_MP_potion15))
if (inventory(43) && inventory (111) && inventory(31)) then (add craft recipe($18="MedMP (25)", @craft_MP_potion25))
if (inventory(43) && inventory (91) && inventory(111) && inventory(31)) then (add craft recipe($19="MedMP (50)", @craft_MP_potion50))
if (inventory(44) && inventory (41)) then (add craft recipe($20="MedMP (100)", @craft_MP_potion100))
# Medecine:
if (inventory(43) && inventory (51)) then (add craft recipe($21="Medicine (Poision) (100)", @craft_Med_P))
if (inventory(51) && inventory (64) && inventory(91)) then (add craft recipe($22="Medicine (Stun)", @craft_Med_S))
if (inventory(64) && inventory (91) && inventory(43) && inventory (112)) then (add craft recipe($23="Medicine(Mute)", @craft_Med_M))
#SCROLLS
if (inventory(102) && inventory(60)) then (add craft recipe($24="Glue Scroll",@craft_glue_scroll))
if (inventory(55) && inventory(91) && inventory(16) && inventory(102)) then (add craft recipe($25="Rage Scroll",@craft_rage_scroll))
if (inventory(114) && inventory(102) && inventory(55)) then (add craft recipe($26="Poision Scroll",@craft_poision_scroll))
if (inventory(91) && inventory(16) && inventory(102)) then (add craft recipe($27="Stun Scroll",@craft_stun_scroll))
if(inventory(66) && inventory(16) && inventory(102)) then (add craft recipe($28="Mute Stun",@craft_mute_scroll))
if (inventory(16) && inventory(102) && inventory(89)) then (add craft recipe($29="Regeneration Scroll",@craft_regeneration_scroll))
if (inventory(52) && inventory(57) && inventory(102)) then (add craft recipe($30="'Heat-Scroll",@craft_heat_scroll))
if (inventory(52) && inventory(102) && inventory(65)) then (add craft recipe($31="Cool-Scroll",@craft_cool_scroll))
if (inventory(52) && inventory(102) && inventory(69)) then (add craft recipe($32="Scroll of Light",@craft_light_scroll))
if (inventory(46) && inventory(16) && inventory(102) && inventory(46)) then (add craft recipe($33="Scroll of Noise",@craft_noise_scroll))
if (inventory(52) && inventory(54) && inventory(102) && inventory(45)) then (add craft recipe($34="Absorb Scroll",@craft_absorb_scroll))
if (inventory(102) && inventory(55) && inventory(16) && inventory(56)) then (add craft recipe($35="Scroll of Dust", @craft_dust_scroll))
if (inventory(56) && inventory(91) && inventory(45) && inventory(91)) then (add craft recipe($36="Scroll of Gardening", @craft_gardening_scroll))
if (inventory(111) && inventory(31) && inventory(45) && inventory(102)) then (add craft recipe($37="Flower Spell Scroll", @craft_flower_scroll))
if (inventory(57) && inventory(102) && inventory(31)) then (add craft recipe($38="Campfire Spell Scroll", @craft_campfire_scroll))
#CHARMS
if (inventory(77) && inventory(16) && inventory(42)) then (add craft recipe($39="Charm of Defense", @craft_charm_def))
if (inventory(77) && inventory(16) && inventory(43)) then (add craft recipe($40="Charm of Dodge", craft_charm_dog))
if (inventory(77) && inventory(16) && inventory(104)) then (add craft recipe($41="Charm of Attk", craft_charm_attk))
if (inventory(77) && inventory(45) && inventory(16)) then (add craft recipe($42="Charm of Aim", @craft_charm_aim))
if (inventory(77) && inventory(16) && inventory(83)) then (add craft recipe($43="Charm of Health", @craft_charm_hp))
if (inventory(54) && inventory(77) && inventory(16)) then (add craft recipe($44="Charm of Confidence", @craft_charm_conf))
if (inventory(16) && inventory(66) && inventory(77) && inventory(45)) then (add craft recipe($45="Charm of Magic", @craft_charm_mag))
if (inventory(52) && inventory(77) && inventory(31) && inventory (16)) then (add craft recipe($46="Charm of MagicPower", @craft_charm_mp))
if (inventory(44) && inventory(31) && inventory(77) && inventory(110)) then (add craft recipe($47="Lucky Charm", @craft_charm_luc))
# RESSOURCES
if (inventory(77) && inventory(104) && inventory (60)) then (add craft recipe($48="empty Scroll",@craft_empty_scroll))
if (inventory(111) && inventory(55) && inventory (43)) then (add craft recipe($49="Ink",@craft_ink))
if (inventory(24) > 3) then (add craft recipe($50="Glue",@craft_glue))
if (inventory(79) && inventory(43)) then (add craft recipe($51="Poision",@craft_poision))
if (inventory (79) && inventory (24) && inventory(111) && inventory(45)) then (add craft recipe($52="RegenerationFluid", @craft_regeneration_fluid))
#TOOLS/ITEMS
if (inventory(104) && inventory(28) && inventory(42)) then (add craft recipe($53="SlingShot", @craft_slingshot))
#ADD LATER
#if (inventory(104) && inventory(16) && inventory (item:46)) then (add craft recipe($51="Speed-Up-Spell",@craft_speed_up))
#if (inventory(101) && inventory(16) && inventory (item:56)) then (add craft recipe($52="Slow-Down-Speed",@craft_speed_down))
end