English Amiga Board


Go Back   English Amiga Board > Coders > Coders. System

 
 
Thread Tools
Old 18 December 2021, 23:05   #1
mateusz_s
Registered User
 
Join Date: Jan 2020
Location: Poland
Posts: 181
Can this application be a Commodity?

Hello,
So I made a very simple Cron like application
that executes any command or script in some time intervals.

I am using it to execute a script that pings my network and setup
ENV variable Online/Offline. That Way and using AmigaOS3.2 I can
have my Internet status updated on my WB menu bar.

The mentioned Cron-like application just runs at system startup
with parameters.

So my question is...
Is that type of application can be rewritten as commodity?
I read that commodities are apps that only takes some input
and then do something with it.

I wanten my Cron-like application to be more "human-friendly"
so it could be controled by Exchange to turn on/off/kill etc..

In my Cron-like app I am just using Delay(time) to get into non-busy "loop"
nad wait to execute command

Thanks in Advance!
mateusz_s is offline  
Old 19 December 2021, 01:29   #2
bwldrbst
Registered User
 
bwldrbst's Avatar
 
Join Date: Nov 2015
Location: Perth, Australia
Posts: 73
You can certainly make it a commodity just so that Exchange can control it. You don't need to register extra key presses. Docs for commodities.library.

Commodities are usually run from WBStartup so you might want to look at using tooltypes or a config file rather than command line parameters.

Rather than using Delay you probably also want to have a look at timer.device for scheduling actions. By using timer.device your main loop becomes a Wait() followed by checking for signals from either the commodity port or the timer. Using Delay means a message might come from Exchange while your program is sleeping and cause problems for the rest of the system.
bwldrbst is offline  
Old 19 December 2021, 01:54   #3
mateusz_s
Registered User
 
Join Date: Jan 2020
Location: Poland
Posts: 181
Quote:
Originally Posted by bwldrbst View Post
You can certainly make it a commodity just so that Exchange can control it. You don't need to register extra key presses. Docs for commodities.library.

Commodities are usually run from WBStartup so you might want to look at using tooltypes or a config file rather than command line parameters.

Rather than using Delay you probably also want to have a look at timer.device for scheduling actions. By using timer.device your main loop becomes a Wait() followed by checking for signals from either the commodity port or the timer. Using Delay means a message might come from Exchange while your program is sleeping and cause problems for the rest of the system.
Hi, thanks for help!
mateusz_s is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Making a commodity - some questions peceha Coders. Blitz Basic 14 11 March 2018 18:41
Helpful commodity idrougge Coders. Blitz Basic 0 14 December 2015 19:51
Translators for a little commodity wanted bubbob42 support.Apps 12 29 May 2014 16:40
Save Prefs on Blanker Commodity manic23 support.Apps 3 22 April 2013 20:12
Looking for Caps2Ctrl commodity kolla support.Apps 7 24 October 2009 17:14

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 19:38.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.06674 seconds with 13 queries