Cockpit

* User Profile

Welcome, Guest. Please login or register.

Login with username, password and session length

Who's Online

  • *Users: 3
  • *Guests: 63
  • *Total: 66

Our Discord

WORLDFLIGHT 2019 - TEAM USA SUPPORTERS (HERO'S)

 
Worldflight 2019
Donations Starting Early
With 50 Days Left, it's time to start Counting Down to Worldflight 2019.  Beginning in August, we had 2 kind gentleman lead the way on our quest for donations to this amazing Charity Event.  Over the Past 6 Years, we (This community) Has helped to raise over $25,000.00USD to help the kids and their families of the All Children's Hospital in St. Petersburgh, Florida.  Kicking off the donations this year these Two Hero's are leading the way to another Successful Year.  I personally want to thank these two Gentleman and use this opportunity to have all of you donate to our wonderful cause. 
Thank you in advance for your help and please wish us much success for our 2019 event.
       
  ---Worldflight 2019 HEROS---

 James Williams, Warren Soeldner,  Sam Llorca, Doug Snow, Ryan O'Keefe, Edwin Burton, Vincent Thomas, Fred Kurasiewicz       





Thanks to all of you, You are all helping to make Worldflight 2019 a success..
Because of all you wonderful people so far we have raised a total of:

$2745.00 USD


Author Topic: How to increase an Lvar value by 6 or -6 ? - ANSWERED  (Read 1392 times)

Offline Stinger2k2

  • Forum GURU
  • *
  • Posts: 15
  • Aviation Enthusiast
  • First Name: Keith
  • Home Location: Bexhill , England
How to increase an Lvar value by 6 or -6 ? - ANSWERED
« on: February 11, 2017, 10:41:26 AM »
Hi,

I am trying to increase the value of my Lvar in increments of 6 from 0-354.

Whats the LUA code for this as my existing code results in
an error saying that I am trying to perform arithmetic on a string.

Heres what I wrote....

function AltPlusSlow
if ipc.readLvar("name") == 354 then
ipc.writeLvar("name", 0) else
ipc.writeLvar("name" +6)
end
end

thanks for looking!

cheers
Stinger
« Last Edit: February 13, 2017, 04:41:05 AM by Stinger2k2 »

Offline Stinger2k2

  • Forum GURU
  • *
  • Posts: 15
  • Aviation Enthusiast
  • First Name: Keith
  • Home Location: Bexhill , England
Re: How to increase an Lvar value by 6 or -6 ?
« Reply #1 on: February 13, 2017, 04:40:22 AM »
Okay now,
A kind fellow on another forum helped me sort it out.
It just needed me to write in a local var.
The code now looks something like this....

function AltPlusSlow
local var = ipc.readLvar("name")
   if var = 354 then
ipc.writeLvar("name", 0)
else
var = var +6
ipc.writeLvar("name", var)
end
end

Sorry for sounding like a coding newbie but
that's exactly what I am !! lol.
cheers
Stinger

Offline Trevor Hale

  • Administrator
  • I am chained to this website!
  • *
  • Posts: 3,878
    • Cockpitbuilders.com
  • First Name: Trevor
  • Home Location: New Liskeard, Ontario
Re: How to increase an Lvar value by 6 or -6 ? - ANSWERED
« Reply #2 on: February 13, 2017, 07:16:14 AM »
Don't be sorry. We all appreciate you posting your answers here.


Thank you.
Trevor Hale

Owner
http://www.cockpitbuilders.com

Director of Operations
Worldflight Team USA
http://www.worldflightusa.com

VATSIM:

 

Recent Posts

My New Computer Specs (feedback please)
by tennyson
[Today at 07:15:46 AM]
Mickey's Flightdeck - A Boeing 737-800 Cockpit on Youtube
by mickc
[Today at 05:36:30 AM]
WORLDFLIGHT 2019 - AVAILABILITY
by gjha97
[September 16, 2019, 07:44:23 PM]
WORLDFLIGHT 2019 - FLIGHT BIDS
by gjha97
[September 16, 2019, 07:40:57 PM]
757/767 PROJECT
by helloo
[September 16, 2019, 11:13:43 AM]
Server Upgrade, and SSL Integration
by Trevor Hale
[September 16, 2019, 10:50:39 AM]
727/737 yokes
by Caflyt
[September 15, 2019, 02:11:06 PM]
WORLDFLIGHT 2019 - Scenery Check Volunteers Needed
by Vincent T.
[September 14, 2019, 03:08:00 PM]
WORLDFLIGHT 2019 - Employer matching for Donations...
by RayS
[September 14, 2019, 12:03:45 AM]
SimFest-West 2019 Videos
by RayS
[September 13, 2019, 07:27:16 PM]
737 MAX Build
by helloo
[September 13, 2019, 04:41:17 PM]
A little pucker factor here, I'm sure... nerves of steel
by RayS
[September 12, 2019, 06:30:45 PM]
Which size fuses to use in fuse block supplying FDS boards?
by blueskydriver
[September 11, 2019, 05:56:37 PM]
I finally got the shell pulled off the ATC-810...
by geneb
[September 11, 2019, 07:29:51 AM]
Wanted: Optoma GT1080Darbee Short Throw Projector
by Flightdeck57
[September 11, 2019, 12:24:08 AM]
F16 Simulator For Sale
by blueskydriver
[September 06, 2019, 03:52:34 PM]
Ebay Assistance
by iwik
[September 06, 2019, 02:00:00 PM]
Matrox 3
by jackpilot
[September 05, 2019, 10:45:00 AM]
So I got a big crate the other day...
by geneb
[September 05, 2019, 09:20:22 AM]
Official WF 2019 Route
by fsaviator
[September 05, 2019, 08:20:10 AM]
Are some sellers off their trolly
by kurt-olsson
[September 02, 2019, 12:39:54 PM]
Display Glare FDS w/Pic
by Joe Lavery
[September 01, 2019, 02:33:47 AM]
MCP
by Caflyt
[August 27, 2019, 06:57:41 PM]
Dispatch and Career Add-on
by fsaviator
[August 26, 2019, 10:42:45 AM]
What have you done for your simulator today?
by B763
[August 25, 2019, 04:58:46 PM]
Free Jet Ranger.
by geneb
[August 23, 2019, 06:16:52 PM]
items/oem from overhead
by gufau
[August 23, 2019, 12:49:15 PM]
Hi everyone!
by jskibo
[August 23, 2019, 08:05:33 AM]
737-800 Front window post size
by kurt-olsson
[August 23, 2019, 03:35:11 AM]
Shipping Woes
by Caflyt
[August 22, 2019, 10:47:49 AM]