Page 1 of 1

Advice with Script: somethign weird with a ")"

Posted: October 18th, 2010, 2:23 pm
by kentl
I got this Script form a older post but did not know your rules on "being threads back form the dead"
and I also edit the script (changed moneys to Coins)
so I hope this is okay

The weirdest part about this whole thing is that one if the script parts dose not work
yet i coped the others form this one and pasted
they all work fine

here is the script

Code: Select all

"level_trigger_2" = "showgui Shopkeeper"
newgui shopkeeper [
Guitext "What are you looking to buy?" chat
Guibar
Guilist [
guibutton "pie: 5 coins" [
if (> then $Coins 4)
Coins = (- $Coins 5)
Pie = (+ $Pie 1) 

I copied the Code above and pasted and edited the pie to swords or treasure
that being said when I talk to him the list appeaser fine

if i click on sword or treasure there is no problems (i have not yet put in him saying "you don't have enough gold " or words to those effects
but the script seems to work
how ever when I click Pie it says "missing )"

I'm thinking its a glitch since the others where coped form that same script and they work
but maybe I'm just blind
"Edit"
Maybe it is the rest of the scripts don't even work?

when i push the button maybe nothing happens?
I don't know
but it is a thought

Re: Advice with Script: somethign weird with a ")"

Posted: October 18th, 2010, 2:57 pm
by PizzaLover101

Code: Select all

"level_trigger_2" 
Can i ask why you have "s around the level trigger? I don't think you need those

Re: Advice with Script: somethign weird with a ")"

Posted: October 18th, 2010, 3:03 pm
by klimyriad
level_trigger_2 = [showgui Shopkeeper]
newgui shopkeeper [
guitext "What are you looking to buy?" chat
guibar
guilist [
guibutton "pie: 5 coins" [
if (> then $Coins 4)
Coins = (- $Coins 5)
Pie = (+ $Pie 1)

There fixed your welcome i hope this helps.

Also btw you may need to improve it, it will not work great unless you make allot more to make it work %100.

Re: Advice with Script: somethign weird with a ")"

Posted: October 18th, 2010, 3:09 pm
by daltonds1
That's cool but what is it for?
im guessing 2.5?

There's tons of different ways to code on this program

i code different from you

Re: Advice with Script: somethign weird with a ")"

Posted: October 18th, 2010, 3:15 pm
by klimyriad
Yes same as me too lol but i know allot of coding.

Re: Advice with Script: somethign weird with a ")"

Posted: October 18th, 2010, 4:55 pm
by kentl
daltonds1 wrote:That's cool but what is it for?
im guessing 2.5?

There's tons of different ways to code on this program

i code different from you
2.6 but since there seems to be a hard time finding anything for 2.6, I use 2.5 stuff

most of 2.5 will work as far as I've seen
I have not yet seen a code that did not work for 2.6 that worked in 2.5

how do you code then?

PizzaLover101 wrote:

Code: Select all

"level_trigger_2" 
Can i ask why you have "s around the level trigger? I don't think you need those
funny story to that
I saw someone use those in a Example and I just thought " What ever its worth a shot"
the script would not work for some reason at all the list would not even come up, for a while I could not figure out why it would not work and I thought maybe the "" helped some how, however, after looking for what felt like hours, I finally figured it out and wow did i feel dumb when I realized one of my [ was a { :oops:

klimyriad wrote:level_trigger_2 = [showgui Shopkeeper]
newgui shopkeeper [
guitext "What are you looking to buy?" chat
guibar
guilist [
guibutton "pie: 5 coins" [
if (> then $Coins 4)
Coins = (- $Coins 5)
Pie = (+ $Pie 1)

There fixed your welcome i hope this helps.

Also btw you may need to improve it, it will not work great unless you make allot more to make it work %100.
Yeah, I tried it, it still says I'm missing a ) for some reason, I'm thinking its a glitch or my really bad script skills, either way I got a feeling it will turn out to be obvious.


Edit
it now works
Since I did nothing that big I think it was just a glitch
maybe the "" did mess it up but I don't know why that would make it say missing )

Re: Advice with Script: somethign weird with a ")"

Posted: October 18th, 2010, 6:45 pm
by chocolatepie33
with if (> then $Coins 4) you don't need then, using " around level triggers is OK, from what I see, you don't have a ] (square bracket, not a parenthesis), which denotes the end of the code section.

Re: Advice with Script: somethign weird with a ")"

Posted: October 19th, 2010, 10:09 am
by arcones
Yeah, that would be needed if it's not at the end of the code. You might want to check your code and see how many of these [ there are to these ] If there are the same amount of each, it should be fine.