Food shelf
I made a food shelf that can store food Dink hunted,but there seems something wrong with it...could anyone help me?
void main(void)
{
}
void talk(void)
{
//choose food store
if (&fsk1 == 0)
{
choice_start();
"Bonca fresh storage"
"Duck storage"
"Fish storage"
"Mushroom storage"
"Pig fresh storage"
"Pumpkin storage"
"Slayer fresh storage"
choice_end();
&fsk1 = &result;
}
choice_start();
(&fsk1 == 1) "Put &fb bonca fresh in"
(&fsk1 == 1) "Take out &fs1 bonca fresh"
(&fsk1 == 2) "Put &fd duck in"
(&fsk1 == 2) "Take out &fs1 duck"
(&fsk1 == 3) "Put &ff fish in"
(&fsk1 == 3) "Take out &fs1 fish"
(&fsk1 == 4) "Put &fm mushroom in"
(&fsk1 == 4) "Take out &fs1 mushroom"
(&fsk1 == 5) "Put &fp pig fresh in"
(&fsk1 == 5) "Take out &fs1 pig fresh"
(&fsk1 == 6) "Put &fpu pumpkin in"
(&fsk1 == 6) "Take out &fs1 pumpkin"
(&fsk1 == 7) "Put &fs slayer fresh in"
(&fsk1 == 7) "Take out &fs1 slayer fresh"
"Leave"
choice_end();
if (&result == 1)
{
if (&fsk1 == 1)
{
&fs1 = &fs1 + &fb;
if (&fs1 > 20)
{
say_stop ("This shelf is full!",1);
&fs1 = 20;
}
&fb = 0;
}
if (&fsk1 == 2)
{
&fs1 = &fs1 + &fd;
if (&fs1 > 20)
{
say_stop ("This shelf is full!",1);
&fs1 = 20;
}
&fd = 0;
}
if (&fsk1 == 3)
{
&fs1 = &fs1 + &ff;
if (&fs1 > 20)
{
say_stop ("This shelf is full!",1);
&fs1 = 20;
}
&ff = 0;
}
if (&fsk1 == 4)
{
&fs1 = &fs1 + &fm;
if (&fs1 > 20)
{
say_stop ("This shelf is full!",1);
&fs1 = 20;
}
&fm = 0;
}
if (&fsk1 == 5)
{
&fs1 = &fs1 + &fp;
if (&fs1 > 20)
{
say_stop ("This shelf is full!",1);
&fs1 = 20;
}
&fp = 0;
}
if (&fsk1 == 6)
{
&fs1 = &fs1 + &fpu;
if (&fs1 > 20)
{
say_stop ("This shelf is full!",1);
&fs1 = 20;
}
&fpu = 0;
}
if (&fsk1 == 7)
{
&fs1 = &fs1 + &fs;
if (&fs1 > 20)
{
say_stop ("This shelf is full!",1);
&fs1 = 20;
}
&fs = 0;
}
}
if (&result == 2)
{
if (&fsk1 == 1)
{
&fb = &fb + &fs1;
&fs1 = 0;
if (&fsk1 == 2)
{
&fd = &fd + &fs1;
&fs1 = 0;
if (&fsk1 == 3)
{
&ff = &ff + &fs1;
&fs1 = 0;
if (&fsk1 == 4
{
&fm = &fm + &fs1;
&fs1 = 0;
if (&fsk1 == 5)
{
&fp = &fp + &fs1;
&fs1 = 0;
if (&fsk1 == 6)
{
&fpu = &fpu + &fs1;
&fs1 = 0;
if (&fsk1 == 7)
{
&fs = &fs + &fs1;
&fs1 = 0;
}
if (&result == 3)
{
}
}
void hit(void)
{
say_stop ("I WANT FOOD!!",1);
}
In the last,I hope that things put in it can be displayed on the shelf...Thanks!
void main(void)
{
}
void talk(void)
{
//choose food store
if (&fsk1 == 0)
{
choice_start();
"Bonca fresh storage"
"Duck storage"
"Fish storage"
"Mushroom storage"
"Pig fresh storage"
"Pumpkin storage"
"Slayer fresh storage"
choice_end();
&fsk1 = &result;
}
choice_start();
(&fsk1 == 1) "Put &fb bonca fresh in"
(&fsk1 == 1) "Take out &fs1 bonca fresh"
(&fsk1 == 2) "Put &fd duck in"
(&fsk1 == 2) "Take out &fs1 duck"
(&fsk1 == 3) "Put &ff fish in"
(&fsk1 == 3) "Take out &fs1 fish"
(&fsk1 == 4) "Put &fm mushroom in"
(&fsk1 == 4) "Take out &fs1 mushroom"
(&fsk1 == 5) "Put &fp pig fresh in"
(&fsk1 == 5) "Take out &fs1 pig fresh"
(&fsk1 == 6) "Put &fpu pumpkin in"
(&fsk1 == 6) "Take out &fs1 pumpkin"
(&fsk1 == 7) "Put &fs slayer fresh in"
(&fsk1 == 7) "Take out &fs1 slayer fresh"
"Leave"
choice_end();
if (&result == 1)
{
if (&fsk1 == 1)
{
&fs1 = &fs1 + &fb;
if (&fs1 > 20)
{
say_stop ("This shelf is full!",1);
&fs1 = 20;
}
&fb = 0;
}
if (&fsk1 == 2)
{
&fs1 = &fs1 + &fd;
if (&fs1 > 20)
{
say_stop ("This shelf is full!",1);
&fs1 = 20;
}
&fd = 0;
}
if (&fsk1 == 3)
{
&fs1 = &fs1 + &ff;
if (&fs1 > 20)
{
say_stop ("This shelf is full!",1);
&fs1 = 20;
}
&ff = 0;
}
if (&fsk1 == 4)
{
&fs1 = &fs1 + &fm;
if (&fs1 > 20)
{
say_stop ("This shelf is full!",1);
&fs1 = 20;
}
&fm = 0;
}
if (&fsk1 == 5)
{
&fs1 = &fs1 + &fp;
if (&fs1 > 20)
{
say_stop ("This shelf is full!",1);
&fs1 = 20;
}
&fp = 0;
}
if (&fsk1 == 6)
{
&fs1 = &fs1 + &fpu;
if (&fs1 > 20)
{
say_stop ("This shelf is full!",1);
&fs1 = 20;
}
&fpu = 0;
}
if (&fsk1 == 7)
{
&fs1 = &fs1 + &fs;
if (&fs1 > 20)
{
say_stop ("This shelf is full!",1);
&fs1 = 20;
}
&fs = 0;
}
}
if (&result == 2)
{
if (&fsk1 == 1)
{
&fb = &fb + &fs1;
&fs1 = 0;
if (&fsk1 == 2)
{
&fd = &fd + &fs1;
&fs1 = 0;
if (&fsk1 == 3)
{
&ff = &ff + &fs1;
&fs1 = 0;
if (&fsk1 == 4
{
&fm = &fm + &fs1;
&fs1 = 0;
if (&fsk1 == 5)
{
&fp = &fp + &fs1;
&fs1 = 0;
if (&fsk1 == 6)
{
&fpu = &fpu + &fs1;
&fs1 = 0;
if (&fsk1 == 7)
{
&fs = &fs + &fs1;
&fs1 = 0;
}
if (&result == 3)
{
}
}
void hit(void)
{
say_stop ("I WANT FOOD!!",1);
}
In the last,I hope that things put in it can be displayed on the shelf...Thanks!
(1)
things like
&fs1 = &fs1 + &fm;
should be coded like
&fs1 += &fm;
(2)A lot of unclosed brackets
(3)You use a space inbetween say_stop (). There should be no space between say_stop()
That's all I can see for now..
Also forgot to close a parenthesis on a condition in one instance.
things like
&fs1 = &fs1 + &fm;
should be coded like
&fs1 += &fm;
(2)A lot of unclosed brackets
(3)You use a space inbetween say_stop (). There should be no space between say_stop()
That's all I can see for now..
Also forgot to close a parenthesis on a condition in one instance.







