Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
22 May, 2013, 02:43:53 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: [1]   Go Down
  Print  
Author Topic: Delay function - Delay function  (Read 448 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
rohanlukose
LV0 Newcomer (Next: 5)

Offline Offline

Last Login: 01 June, 2012, 19:53:18
Date Registered: 01 June, 2012, 19:47:34
Posts: 1

Topic starter
Total Post Ratings: 0

View Profile
« on: 01 June, 2012, 19:49:44 »
0

Does any one know about delay/sleep function that can be used with nspire lua as on.clock() wont work Huh?
Logged
aeTIos
You got stair'd!
LV12 Extreme Poster (Next: 5000)
************
Offline Offline

Gender: Male
Last Login: Yesterday at 23:59:53
Date Registered: 15 September, 2010, 06:00:00
Location: Netherlands, Overijssel
Posts: 3118


Total Post Ratings: +120

View Profile
« Reply #1 on: 01 June, 2012, 19:54:18 »
0

Welcome on the forums! You should introduce yourself!
There are plenty experienced Lua programmers out here, so I'm sure they will figure it out for you Cheesy
« Last Edit: 01 June, 2012, 19:54:33 by aeTIos » Logged

If something above sounds rude, feel free to vote it down, it was not meant to be rude<<lolol
--Always stay relAXEd!--


Spoiler for Hidden:


[







Spoiler for Still Alive:
This was a triumph.
I'm making a note here: HUGE SUCCESS.
It's hard to overstate my satisfaction.

Aperture Science:
We do what we must because we can.
For the good of all of us
Except the ones who are dead.

But there's no sense crying over every mistake
You just keep on trying till you run out of cake
And the science gets done and you make a neat gun
For the people who are still alive.

I'm not even angry.
I'm being so sincere right now.
Even though you broke my heart and killed me.
And tore me to pieces.
And threw every piece into a fire.
As they burned it hurt because
I was so happy for you.

Now these points of data make a beautiful line
And we're out of beta we're releasing on time.
So I'm GLaD I got burned think of all the things we learned
For the people who are still alive.

Go ahead and leave me.
I think I prefer to stay inside.
Maybe you'll find someone else to help you.
Maybe Black Mesa -
THAT WAS A JOKE. HA HA, FAT CHANCE.
Anyway, this cake is great:
It's so delicious and moist.

Look at me still talking when there's science to do.
When I look out there it makes me GLaD I'm not you.
I've experiments to run there is research to be done
On the people who are still alive

And believe me I am still alive.
I'm doing science and I'm still alive.
I feel FANTASTIC and I'm still alive.
While you're dying I'll be still alive.
And when you're dead I will be still alive.

Still alive
Still alive
Nick
LV9 Veteran (Next: 1337)
*********
Offline Offline

Gender: Male
Last Login: 20 May, 2013, 20:44:19
Date Registered: 05 June, 2011, 20:01:07
Location: 51° 12′ 34″ N, 3° 13′ 31″ E
Posts: 1178


Total Post Ratings: +158

View Profile WWW
« Reply #2 on: 01 June, 2012, 20:54:55 »
0

on.clock() ? never heard of it ö i program in lua Smiley well, you can use the timer to make your own delay function, but there's no native one..

timer.getMilliSecCounter() returns the nr of milliseconds since the calc rebooted, that way you can make your own
Logged

jwalker
LV7 Elite (Next: 700)
*******
Offline Offline

Gender: Male
Last Login: Yesterday at 23:16:04
Date Registered: 20 December, 2011, 00:20:52
Location: its cold outside
Posts: 600


Total Post Ratings: +10

View Profile
« Reply #3 on: 01 June, 2012, 21:14:41 »
0

you could use on.tick
Logged


My computer geek score is greater than 41% of all people in the world! How do you compare? Click here to find out!


Support Casio-Scene against the attacks of matt @ matpac.co.uk ! For more information: Casio-Scene shuts down & Matt actions threads
adriweb
Editor
LV9 Veteran (Next: 1337)
*
Offline Offline

Gender: Male
Last Login: 20 May, 2013, 00:38:33
Date Registered: 13 April, 2011, 18:42:59
Location: South of France
Posts: 1196


Total Post Ratings: +185

View Profile WWW
« Reply #4 on: 01 June, 2012, 23:34:30 »
0

There has been some topics already about this kind of things.

Generally (with all due respect), you don't really have to really "pause" the script flow directly, but maybe you just mess with on.timer (not 'on.clock', nor 'on.tick'), which is called every tick, whose period is define by timer.start
« Last Edit: 02 June, 2012, 12:28:22 by adriweb » Logged


TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation
Juju
Evil Fluttershy (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Coder Of Tomorrow
LV12 Extreme Poster (Next: 5000)
*
Offline Offline

Gender: Male
Last Login: Today at 01:24:30
Date Registered: 17 March, 2010, 07:46:57
Location: Québec, North Equestria
Posts: 4536


Total Post Ratings: +394

View Profile WWW
« Reply #5 on: 02 June, 2012, 01:04:16 »
0

Yeah, you'll want to start a timer or save the current time, then check if your desired number of time has been elapsed.
« Last Edit: 02 June, 2012, 01:04:59 by Juju » Logged

LuaIDE
Reuben Quest HD: The PC Remake
Zarmina Project: Play Read
Nspire I/O: Info Download


THEGAME
Spoiler for Other stuff:
Also Yuki "ジュジュ" Kagayaki
Support Casio-Scene against the attacks of matt @ matpac.co.uk ! For more information: Casio-Scene shuts down & Matt actions threads
Find what P+4zJ means and you get free candy! cc4daa9c4645bd123ed22e385ed701fd
#omnimaga on OmniNet, EFNet and Pesterchum
Omnimaga Owner and Former Administrator
Fan of My Little Jim Bauwens: Losing the Game is Magic
Proud member of POLN - Ponys Oppositing Lol Names
Member of OBEL - Omnimaga Board of the EFnrgelnicshh Language - Office Omnimagois de la Langue FArnagnlçaaiiss
あなたはこのゲームを失った
Spoiler for Old spoileryception stuff:

Spoiler for Coming soon...:
Indefinitely halted [|.........] 10%
OmnomIRC Mobile [||||......] 40% (argh threads >_<)
Spoiler for Current/Past TI-related projects:
The Axe Parser Wiki / Founder and maintainer
Keytar Hero [|||||_____] 50% Engine done, wackiness left to do (Halted)
OmniOS
VVVVVV [||||______] 40% (Made most of the engine, extremely glitchy) (Gave it to Leafy)
░█▀█░█░█░█▀▀░█▀█░█▀█░█▀█░▀█▀░█▀▄
░█▀█░▄▀▄░█▀▀░█▀█░█░█░█░█░░█░░█░█
v0.1.0
░▀░▀░▀░▀░▀▀▀░▀░▀░▀░▀░▀▀▀░▀▀▀░▀▀░[|||||||||¦] 95ish% (Completed)
tilibs-wii? [._________] 0% (Nope.)
Spoiler for Spoilers:
<!---->
wxWabbitemu Developer
Spoiler for Other Userbars:






<!--Everything done, got 90% Cheesy sudo apt-get install z80asm z80dasm-->
Spoiler for Quote:
We are in 2034. The situation on Earth is catastrophic. The ozone layer has been completely destroyed by the carbonic gas of automobiles, the chemical industries, and the poosh-poosh in little cans. In the end, the earth cooks under the rays of the sun. We must find a planet on which can live 6 billion idiots. The planetary federation turns to the strongest country in the world: Canada. It is Canadian knowledge that has allowed, on October 28, 2034, the launch of the spaceship Romano Fafard, which leaves earth to search the confines of the Universe. Where the hand of man has never set foot.
I hate TI right now
Quote from: jimbauwens
You make me lose the game
Everytime I read your name
Spoiler for The real answer to life, the universe and everything:
Spoiler for Old HTML stuff:
<div style="margin:20px; margin-top:5px"><div class="smallfont" style="margin-bottom:2px">Spoiler for This is another spoiler: <input type="button" value="Show" style="width:60px;font-size:10px;margin:0px;padding:0px;" onclick="window.location.replace('http://goo.gl/QMET');"></div><div class="alt2" style="margin: 0px; padding: 6px; border: 1px inset;"><div style="display: none; ">HAHAHA SUCCESSFUL RICKROLL IS SUCCESSFUL</div></div></div><!-- old avatars:
http://fc00.deviantart.net/fs71/f/2011/120/d/f/nepeta_nyan_cat_by_supuru-d3f8tcx.gif
http://th01.deviantart.net/fs70/PRE/i/2011/099/5/b/rainbow_dash_derping_by_moongazeponies-d3dmg7l.png--><!---->
I may or may not be inactive during work hours (9AM to 5PM EST, Monday to Friday), so for any inquiries please leave a message after the beep and I'll answer you when I have time. Beep. Nevermind, I'm on vacation now. Cheesy
Jim Bauwens
Lua! Nspire! Linux!
Editor
LV10 31337 u53r (Next: 2000)
*
Offline Offline

Gender: Male
Last Login: Yesterday at 22:53:52
Date Registered: 28 February, 2011, 22:32:12
Location: Belgium
Posts: 1733


Total Post Ratings: +180

View Profile WWW
« Reply #6 on: 02 June, 2012, 11:44:25 »
0

One important difference with the Lua API (and also with the Love API) is that it is event based.
Tight while loops are not recommended. This might be confusing in the beginning, but you will appreciate it in the end Wink

So you will need to use the timer system. timer.start(x) will make that the on.timer event will fire every x seconds.
You will have to define on.timer so that it does the changes you want and then invalidates the screen so that the screen will be redrawn.
« Last Edit: 02 June, 2012, 11:45:04 by jimbauwens » Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.392 seconds with 30 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.