Goldbar Made Clickable (need quite help)

Mu online season 21 - grand opening

mStation

Golden Oldie
Golden Oldie
Oct 29, 2003
2,042
69
235
♫♪♫ ♦♥♠♣ ♀♂♀
Hello.. i'm over this script for about a few hours now.. and i'm really getting sick :)

this is what i have in qfunction:
Code:
[@StdModeFunc60]
#SAY
**** GOLDBARS ****\ \
Hello, what do you want to do?\ \
<Bundle/@bundlebar> , <Change to Cash/@cashbar> , <Nothing/@exit>
#ACT
GIVE GoldBar 1
BREAK

[@bundlebar]
#IF
CHECKITEM GoldBar 5
#ACT
TAKE GoldBar 5
GIVE GoldBarBundle 1
BREAK
#ELSESAY
Something Went Wrong! This happened because:\ \
- You Do Not Have 5 GoldBars To Exchange!\
<Cancel/@exit>

[@cashbar]
#IF
CHECKITEM GoldBar 1
checkgold 99000001
#SAY
Something Went Wrong! This maybe happened because:\ \
- You Might Have Reached Your Bag Limit (99+ M)\
- Or You Have Taken Out of Your Bag The GoldBar!!\ \
<Cancel/@exit>
#ELSEACT
take goldbar 1
give gold 1000000
#ELSESAY
GoldBar was Exchanged into money.\
<Cancel/@exit>

PROBLEM: when u click on the goldbar you get all your choices working correctly but if you click on the goldbar.. it will dissapear..then on row 7 i make it re-appear in bag.. but if you click on it and drop it on the floor and then press on "Change to Cash".. it will give the cash to the player even though the goldbar isn't in the bag.. i have already inserted a CHECKITEM goldbar 1 in the [@cashbar] function but it still doesn't work.. any ideas?
 
Last edited:

mStation

Golden Oldie
Golden Oldie
Oct 29, 2003
2,042
69
235
♫♪♫ ♦♥♠♣ ♀♂♀
okay... i just realised that if u make a check function like this it works..

[@StdModeFunc60]
#SAY
**** GOLDBARS ****\ \
Hello, what do you want to do?\ \
<Bundle/@bundlebar> , <Change to Cash/@checkbar> , <Nothing/@exit>
#ACT
GIVE GoldBar 1
BREAK

[@bundlebar]
#IF
CHECKITEM GoldBar 5
#ACT
TAKE GoldBar 5
GIVE GoldBarBundle 1
BREAK
#ELSESAY
Something Went Wrong! This happened because:\ \
- You Do Not Have 5 GoldBars To Exchange!\
<Cancel/@exit>

[@checkbar]
#IF
CHECKITEM GoldBar 1
#ACT
goto @cashbar
#ELSESAY
You have taken out of your bag the goldbar.\
<Cancel/@exit>


[@cashbar]
#IF
checkgold 99000001
#SAY
Something Went Wrong! This maybe happened because:\ \
- You Might Have Reached Your Bag Limit (99+ M)\
- Or You Have Taken Out of Your Bag The GoldBar!!\ \
<Cancel/@exit>
#ELSEACT
take goldbar 1
give gold 1000000
#ELSESAY
GoldBar was Exchanged into money.\
<Cancel/@exit>

but i'd like to know why the previous script didnt work.. :S
 
Last edited:
Upvote 0

TravisW

LOMCN Veteran
Veteran
Sep 4, 2007
737
17
105
[@StdModeFunc60]
#SAY
**** GOLDBARS ****\ \
Hello, what do you want to do?\ \
<Bundle/@bundlebar> , <Change to Cash/@cashbar> , <Nothing/@leave>

[@bundlebar]
#IF
CHECKITEM GoldBar 5
#ACT
TAKE GoldBar 5
GIVE GoldBarBundle 1
CLOSE
#ELSEACT
give goldbar 1
#ELSESAY
Something Went Wrong! This happened because:\ \
- You Do Not Have 5 GoldBars To Exchange!\
<Cancel/@exit>

[@cashbar]
#IF
checkgold 99000001
#ACT
give goldbar 1
#SAY
Something Went Wrong! This maybe happened because:\ \
- You Might Have Reached Your Bag Limit (99+ M)\
- Or You Have Taken Out of Your Bag The GoldBar!!\ \
<Cancel/@exit>
#ELSEACT
Give Gold 1000000
CLOSE

[@leave]
#ACT
give goldbar 1
CLOSE

#EDIT:eek:pps, now it works

that should work nicely. =p
Don't need to check for bar, if they've clicked it they had it. hehe
 
Last edited:
Upvote 0

TravisW

LOMCN Veteran
Veteran
Sep 4, 2007
737
17
105
yep, thats because once you dbl click the bar, its gone, unless the script gives it back.
might be better to just have the items clickable for cash only, then make a command like @gold to make bars/etc.

[@stdmodefunc60]
#IF
CHECKGOLD 99000001
#ACT
give goldbar 1
break
#ELSEACT
give gold 1000000
break
 
Upvote 0

Tom27

Golden Oldie
Golden Oldie
Sep 15, 2005
1,877
78
185
Norwich
Yeah but you could bump into a problem, I'll give you a hint

"Gold Limit Reached"

POOF

GoldBar = Thin Air

Think outside the box xD
 
Upvote 0

TravisW

LOMCN Veteran
Veteran
Sep 4, 2007
737
17
105
Yeah but you could bump into a problem, I'll give you a hint

"Gold Limit Reached"

POOF

GoldBar = Thin Air

Think outside the box xD

lol, thats what the

#IF
CHECKGOLD 99000001
#ACT
give GoldBar 1
break

bit is for, read inside the post.
 
Upvote 0

mStation

Golden Oldie
Golden Oldie
Oct 29, 2003
2,042
69
235
♫♪♫ ♦♥♠♣ ♀♂♀
i'm using this script now and i think it covers every possible case.. its quite long and maybe messy but you can do everything with qfunction.. no need of npc's and no worries of exploits.. u can try it if u want and tell me if u can exploit..

Code:
;=====================================================
;Double clickable Goldbars

[@StdModeFunc60]
#SAY
**** GOLDBARS ****\ \
Hello, what do you want to do?\ \
<Bundle/@bundlebar> , <Change to Cash/@checkbar> , <Nothing/@exit>
#ACT
GIVE GoldBar 1
BREAK

[@bundlebar]
#IF
CHECKITEM GoldBar 5
#ACT
TAKE GoldBar 5
GIVE GoldBarBundle 1
close
BREAK
#ELSESAY
Something Went Wrong! This happened because:\ \
- You Do Not Have 5 GoldBars To Exchange!\
<Cancel/@exit>

[@checkbar]
#IF
CHECKITEM GoldBar 1
#ACT
goto @cashbar
#ELSESAY
You Have Taken Out Of Your Bag The Goldbar.\
<Cancel/@exit>

[@cashbar]
#IF
checkgold 99000001
#SAY
Something Went Wrong! This happened because:\ \
- You Might Have Reached Your Bag Limit (99+ M)\
- Or You Have Taken Out of Your Bag The GoldBar!!\ \
<Cancel/@exit>
#ELSEACT
take goldbar 1
give gold 1000000
#ELSESAY
GoldBar Was Exchanged into money.\
<Cancel/@exit>

;=====================================================
;Double clickable GoldbarBundles

[@StdModeFunc61]
#SAY
**** GOLDBARBUNDLE ****\ \ 
Hello, what do you want to do?\ \
<Bundle/@bundlebun> , <Unbundle/@unbundlebun>\
<Change to Cash/@checkbun> , <Nothing/@exit>
#ACT
GIVE GoldBarBundle 1
BREAK

[@bundlebun]
#IF
CHECKITEM GoldBarBundle 2
#ACT
TAKE GoldBarBundle 2
GIVE GoldChest 1
close
BREAK
#ELSESAY
Something Went Wrong! This happened because:\ \
- You Do Not Have 2 GoldBarBundles To Exchange!\
<Cancel/@exit>

[@unbundlebun]
#IF
CHECKITEM GoldBarBundle 1
CHECKBAGSIZE 5
#ACT
TAKE GoldBarBundle 1
GIVE GoldBar 5
close
BREAK
#ELSESAY
Something Went Wrong! This happened because:\ \
- You Do Not Have No GoldBarBundles or\ \
- You Dont Have 5 Spare spaces for the Bars..\
<Cancel/@exit>

[@checkbun]
#IF
CHECKITEM GoldBarBundle 1
#ACT
goto @cashbun
#ELSESAY
You Have Taken Out Of Your Bag The GoldBarBundle.\
<Cancel/@exit>

[@cashbun]
#IF
CHECKITEM GoldBarBundle 1
checkgold 95000001
#SAY
Something Went Wrong! This happened because:\ \
- You Might Have Reached Your Bag Limit (95+ M)\
- Or You Have Taken Out of Your Bag The GoldBarBundle!!\ \
<Cancel/@exit>
#ELSEACT
take goldbarbundle 1
give gold 5000000
#ELSESAY
GoldBarBundle was Exchanged into money.\
<Cancel/@exit>

;=====================================================
;Double clickable GoldChests

[@StdModeFunc62]
#SAY
**** GOLDCHESTS ****\ \ 
Hello, what do you want to do?\ \
<Bundle/@bundlech> , <Unbundle/@unbundlech>\
<Change to Cash/@checkch> , <Nothing/@exit>
#ACT
GIVE GoldChest 1
BREAK

[@bundlech]
#IF
CHECKITEM GoldChest 5
#ACT
TAKE GoldChest 5
GIVE Diamonds 1
close
BREAK
#ELSESAY
Something Went Wrong! This happened because:\ \
- You Do Not Have 5 GoldChests To Exchange!\
<Cancel/@exit>

[@unbundlech]
#IF
CHECKITEM GoldChest 1
CHECKBAGSIZE 2
#ACT
TAKE GoldChest 1
GIVE GoldBarBundle 2
close
BREAK
#ELSESAY
Something Went Wrong! This happened because:\ \
- You Do Not Have No GoldChests or\ \
- You Dont Have 2 Spare spaces for the Bundles..\
<Cancel/@exit>

[@checkch]
#IF
CHECKITEM GoldBarBundle 1
#ACT
goto @cashch
#ELSESAY
You Have Taken Out Of Your Bag The GoldChest.\
<Cancel/@exit>

[@cashch]
#IF
checkgold 90000001
#SAY
Something Went Wrong! This happened because:\ \
- You Might Have Reached Your Bag Limit (90+ M)\
- Or You Have Taken Out of Your Bag The GoldChest!!\ \
<Cancel/@exit>
#ELSEACT
take goldchest 1
give gold 10000000
#ELSESAY
GoldChest was Exchanged into money.\
<Cancel/@exit>

;=====================================================
;Double clickable Diamonds

[@StdModeFunc63]
#SAY
**** DIAMONDS ****\ \
Hello, what do you want to do?\ \
<Bundle/@bundled> , <Unbundle/@unbundled>\
<Change to Cash/@checkd> , <Nothing/@exit>
#ACT
GIVE Diamonds 1
BREAK

[@bundled]
#IF
CHECKITEM Diamonds 2
#ACT
TAKE Diamonds 2
GIVE DiamondChest 1
close
BREAK
#ELSESAY
Something Went Wrong! This happened because:\ \
- You Do Not Have 2 Diamonds To Exchange!\
<Cancel/@exit>

[@unbundled]
#IF
CHECKITEM Diamonds 1
CHECKBAGSIZE 5
#ACT
TAKE Diamonds 1
GIVE GoldChest 5
close
BREAK
#ELSESAY
Something Went Wrong! This happened because:\ \
- You Do Not Have No Diamonds or\ \
- You Dont Have 5 Spare spaces for the Chests..\
<Cancel/@exit>

[@checkd]
#IF
CHECKITEM Diamonds 1
#ACT
goto @cashd
#ELSESAY
You Have Taken Out Of Your Bag The Diamonds.\
<Cancel/@exit>

[@cashd]
#IF
checkgold 50000001
#SAY
Something Went Wrong! This happened because:\ \
- You Might Have Reached Your Bag Limit (50+ M)\
- Or You Have Taken Out of Your Bag The Diamonds!!\ \
<Cancel/@exit>
#ELSEACT
take diamonds 1
give gold 50000000
#ELSESAY
Diamonds Exchanged into money.\
<Cancel/@exit>

;=====================================================
;Double clickable DiamondChest

[@StdModeFunc64]
#SAY
**** DIAMOND CHEST ****\ \
Hello, what do you want to do?\ \
<Unbundle/@unbundledc> , <Nothing/@exit>\
#ACT
GIVE DiamondChest 1
BREAK

[@unbundledc]
#IF
CHECKITEM Diamondchest 1
CHECKBAGSIZE 2
#ACT
TAKE DiamondChest 1
GIVE Diamonds 2
close
BREAK
#ELSESAY
Something Went Wrong! This happened because:\ \
- You Do Not Have No DiamondChest or\ \
- You Dont Have 2 Spare spaces for the Diamonds..\
<Cancel/@exit>

;=====================================================

ps: bear in mind a few things:

in stditems i made that goldbars, goldbarbundles, goldchests, diamonds, and diamondchests are items with FLD_STDMode 31, FLD_SHAPE 0 and Anicount which is 60 for goldbars, 61 for goldbarbundles, 62 for goldchests, 63 for diamonds and 64 for diamonds chests..

also remember that my !setup has HumanMaxGold=100000000

diamonds are worth 5 goldchests and diamondschests are worth 2 diamonds..

this means that u must add to new items in the db to use this script correctly
 
Upvote 0

TravisW

LOMCN Veteran
Veteran
Sep 4, 2007
737
17
105
Invalid pointers for this lol, seriously i wouldn`t bother let them exchange via an npc.
ye, maybe u did it wrong, I have same, and haven't gotten invalid pointer operation on m2server once. That coming from a guy who can't keep his m2server up, lol
 
Last edited:
Upvote 0

transporter

LOMCN Veteran
Veteran
Jul 12, 2008
608
8
105
Darlington
ye, maybe u did it wrong, I have same, and haven't gotten invalid pointer operation on m2server once. That coming from a guy who can't keep his m2server up, lol


So you get no invalid pointers at all? Not even on EXP-Potions ?

Bull****!

And my M2 only closes because of Vista.

And i was not on about this script, i wouldn`t bother with useing Q-fuction for gold bars etc, when it`s easily done via an NPC.
 
Last edited:
Upvote 0

azzi

Golden Oldie
Golden Oldie
Aug 16, 2005
1,662
19
175
[@StdModeFunc60]
#SAY
**** GOLDBARS ****\ \
Hello, what do you want to do?\ \
<Bundle/@bundlebar> , <Change to Cash/@cashbar> , <Nothing/@exit>
#ACT
GIVE GoldBar 1
BREAK

[@bundlebar]
#IF
CHECKITEM GoldBar 5
#ACT
TAKE GoldBar 5
GIVE GoldBarBundle 1
BREAK
#ELSESAY
Something Went Wrong! This happened because:\ \
- You Do Not Have 5 GoldBars To Exchange!\
<Cancel/@exit>

[@cashbar]
#IF
CHECKITEM GoldBar 1
checkgold 99000001
#SAY
Something Went Wrong! This maybe happened because:\ \
- You Might Have Reached Your Bag Limit (99+ M)\
- Or You Have Taken Out of Your Bag The GoldBar!!\ \
<Cancel/@exit>
#ELSEACT
checkitem goldbar 1
take goldbar 1
give gold 1000000
#ELSESAY
GoldBar was Exchanged into money.\

<Cancel/@exit>

There! that should make it work 4 u
 
Upvote 0