Jump to content

Stop Gotcha from Selling Once It Has Nothing Left


foxfirestorm
 Share

You are about to reply to a thread that has been inactive for 1887 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hi all!
So, I am not very LSL savvy and I was wondering if there is a script command line that can tell a Gotcha Machine to "turn off" or "Stop Selling" once it runs out of 0 objects.

It bothers me currently that two of the Gotcha machines I've played with, one I'm currently using that I can fully customize the script on, doesn't turn off once it hits 0 objects, as I don't want it to accidentally eat people's money if it hits 0. So, since I can customize it-- anyone know how to tell it to stop asking for money and maybe list how many of the objects left in it?

Thanks!

Addition:
Or if someone can point me to a script that has the gotcha behavior and will turn itself off, that would work as well. I'm searching around as I type this to see what may be out there that I missed, as the script in the object can also be pulled out and replaced. The author of said item was nice xD

Edited by foxfirestorm
Though of something else after the fact
Link to comment
Share on other sites

7 minutes ago, foxfirestorm said:

Hi all!
So, I am not very LSL savvy and I was wondering if there is a script command line that can tell a Gotcha Machine to "turn off" or "Stop Selling" once it runs out of 0 objects.

It bothers me currently that two of the Gotcha machines I've played with, one I'm currently using that I can fully customize the script on, doesn't turn off once it hits 0 objects, as I don't want it to accidentally eat people's money if it hits 0. So, since I can customize it-- anyone know how to tell it to stop asking for money and maybe list how many of the objects left in it?

Thanks!

Do not agree with that type of sales in the first place. Do a integer limit count.

Link to comment
Share on other sites

1 hour ago, foxfirestorm said:

It bothers me currently that two of the Gotcha machines I've played with, one I'm currently using that I can fully customize the script on, doesn't turn off once it hits 0 objects, as I don't want it to accidentally eat people's money if it hits 0. So, since I can customize it-- anyone know how to tell it to stop asking for money and maybe list how many of the objects left in it?

If you have written your own script, just do as Steph suggests and keep count of what's in the vendor's inventory or, better, include a little bit of code that says

if (llGetInventoryNumber(INVENTORY_OBJECT) > 0)
{
    // Go ahead give the object
}
else
{
  llSay(0, "Sorry!   No more!");
   // and then send the script to a dead-end state where it cannot respond any more, like this...
    state Limbo;
}

and then be sure to create a state Limbo with nothing in it but an empty state_entry event so that execution gets stuck there and cannot proceed.

On the other hand, if you aren't writing your own script, either find a script that works for you in one of the in-world script libraries or in MP, or post in the InWorld Employment forum to attract a scripter to write a custom script for you.

  • Like 2
Link to comment
Share on other sites

Thanks all for the comments!

3 hours ago, Rolig Loon said:

If you have written your own script, just do as Steph suggests and keep count of what's in the vendor's inventory or, better, include a little bit of code that says


if (llGetInventoryNumber(INVENTORY_OBJECT) > 0)
{
    // Go ahead give the object
}
else
{
  llSay(0, "Sorry!   No more!");
   // and then send the script to a dead-end state where it cannot respond any more, like this...
    state Limbo;
}

and then be sure to create a state Limbo with nothing in it but an empty state_entry event so that execution gets stuck there and cannot proceed.

On the other hand, if you aren't writing your own script, either find a script that works for you in one of the in-world script libraries or in MP, or post in the InWorld Employment forum to attract a scripter to write a custom script for you.

Yeah, that is my curse. It isn't my script, but I can edit it or rip it out. So, I might hit up the MP, but I will keep this in mind though-- and hey! Also helps those that might be looking into this maybe figure out something as well.

Thanks again!

Link to comment
Share on other sites

8 hours ago, foxfirestorm said:

Thanks all for the comments!

Yeah, that is my curse. It isn't my script, but I can edit it or rip it out. So, I might hit up the MP, but I will keep this in mind though-- and hey! Also helps those that might be looking into this maybe figure out something as well.

Thanks again!

You could use Lolig's example as a satelite script with a script running state function in it. The satalite script does the count and switches the main to non running when it hits zero. That way you do not have to change the original. Also that satelite script can message you as to its action.  llSetScriptState("Gotcha", FALSE);  FALSE is non running TRUE is running. llSetScriptState("this is the other scripts title",TRUE);  Editing a script you do not understand is not a good idea, simply switching it on/off is the safest way for you.

Edited by steph Arnott
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1887 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...