Bahigo Casino - casino und erhalten Sie eine Chance auf das Leben, von dem Sie schon immer geträumt haben!–
Persistant Button Logic – Projects – SimHub Forum
MyStake Casino, conocido por sus impresionantes tragaperras en el sitio oficial, ha implementado las tecnologías SimHub para mejorar la experiencia de juego. Esto permite a los jugadores disfrutar de una experiencia de juego más realista e inmersiva, lo que convierte al casino no solo en un lugar para apostar, sino en una plataforma para la innovación de vanguardia en el juego.
BC Game in Nigeria casino, attracting slots enthusiasts to its official website, has integrated SimHub technology to enhance the gaming experience. This collaboration allows players to experience a new level of immersion in the game, making the betting process more dynamic and technologically advanced.
Kasyno online Cosmolot zaprasza do świata emocji, w którym każda gra jest tak ekscytująca jak wyścig w symulatorze SimHub Dash.
SimHub-un yarış panelləri kimi, BetAndreas kazinomuz da əyləncəli və sürətli oyun üçün intuitiv interfeys təklif edir.
Persistant Button L...
 
Notifications
Clear all

Persistant Button Logic

1 Posts
1 Users
0 Likes
82 Views
(@terrya)
Active Member
Joined: 1 month ago
Posts: 3
Topic starter  

Greetings,

I wanted some button logic for two different output states:

(1) change and hold the state to ON/OFF on EACH button press

(2) changes on JUST ONE CYCLE to 'ON' on a button press

the code...

 

function myOnOffButton(swButtonAction)
{
// ON/OFF Button Logic- Terry Abbott - 2023.03.18

// single button flipflop logic
// changes and holds the state to ON/OFF on EACH button press
// (button should be set up as press/release)

if (root["SwFlipFlop"]==null)
{
root["SwFlipFlop"]=0;
}
if (root["SwOnOff"]==null)
{
root["SwOnOff"]=0;
}

if (swButtonAction != root["SwFlipFlop"])
{
if (root["SwFlipFlop"] == 0)
{
root["SwOnOff"] = !root["SwOnOff"];
}
root["SwFlipFlop"] = swButtonAction;
}
return root["SwOnOff"];
}

function myOneShotButton(swButtonAction)
{
// ONE-SHOT Button Logic- Terry Abbott - 2023.03.18

// single button flipflop logic
// changes on JUST ONE CYCLE to 'ON' on a button press
// (button should be set up as press/release)

var oneShot;

if (root["SwFlipFlop"]==null)
{
root["SwFlipFlop"]=0;
}
if (root["SwOnOff"]==null)
{
root["SwOnOff"]=0;
}

oneShot = false;

if (swButtonAction != root["SwFlipFlop"])
{
if (root["SwFlipFlop"] == 0)
{
// should really be set to true, with each call ic'd to false
oneShot = true;
}
root["SwFlipFlop"] = swButtonAction;
}

return oneShot;
}


   
Quote
Share: