Author Topic: jBasic OS  (Read 42219 times)

0 Members and 2 Guests are viewing this topic.

Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: jBasic OS
« Reply #75 on: June 21, 2010, 12:13:56 am »
Lol, I'm posting this from in jbasic OS, through the google browser.

Any chance at a URL Bar for that? Also, When I made the Browser large enough to use, the bar got cut in half, so only the bottom half of "Google Browser" and the circles are visible

I noticed that This browser has Flash support :P Is that cause it's running in firefox with flash enabled?

Edit: Hang on, now the whole window bar is gone.
« Last Edit: June 21, 2010, 12:14:45 am by willrandship »

_player1537

  • Guest
Re: jBasic OS
« Reply #76 on: June 21, 2010, 12:16:19 am »
I tried messing with the code to add that...didn't get it to work though x.x

Edit:
W00T!!
got some code to work :P  it makes a window, and whenever you click the button on it it creates another window with another button (the new one doesn't do anything).  How do I use random numbers in JS?

Here is my code:
Code: [Select]
function AB_open(){
window_create('BUTTONZ','','',100,100,"<input type='button' onclick='AB_Windowz()'></input>");
}
function AB_Windowz(){
window_create('BUTTONZ 2','','',100,100,"<input type='button'></input>");
}
« Last Edit: June 21, 2010, 12:48:58 am by _player1537 »

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6265
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: jBasic OS
« Reply #77 on: June 21, 2010, 01:05:24 am »
Willrandship could you post a screenshot?
Player: try changing it to onlick="AB_open()" :p (yes i have support for multiple windows supoorted :))
/e

_player1537

  • Guest
Re: jBasic OS
« Reply #78 on: June 21, 2010, 01:06:58 am »
yeah, I decided against doing that mainly because I am going to throw in alerting later. :)  also I made 30 BUTTONZ 2 windows XD

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6265
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: jBasic OS
« Reply #79 on: June 21, 2010, 01:10:46 am »
Ah ok :) question, do you know how to create tasks yet? You should try playing around with that.
/e

_player1537

  • Guest
Re: jBasic OS
« Reply #80 on: June 21, 2010, 01:11:35 am »
nope, also I am trying to find your original JBasic file, I need the random command from it x.x

Edit: found it
« Last Edit: June 21, 2010, 01:12:06 am by _player1537 »

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6265
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: jBasic OS
« Reply #81 on: June 21, 2010, 01:15:41 am »
Ah k. Well. I should document it for you.
Lol, yeah, there are a few commands i need to add to the extended functions list. I will add that later, thanks for reminding me :)

Btw, with tasks you can make intterupts for keypresses :D so like it alert for certain keys that are down and such. :)
/e

_player1537

  • Guest
Re: jBasic OS
« Reply #82 on: June 21, 2010, 01:20:02 am »
ooh, what is this task code called, only the function and arguments, and a basic understanding of how the tasks work should be fine for now :)

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6265
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: jBasic OS
« Reply #83 on: June 21, 2010, 01:25:49 am »
Well, i cant remember for sure, but i thibk it was tasker_task_create() or something. Look in Tasks.js in js/ it should be there, along with the arguements.

All the tasker does is schedule intervals between what you want run. And in the case of low fps it increases the intervals.
You will have to figure out how to end a task wjen a window quits on your own for now. I have yet to add a onclose() function of any sort.
/e

_player1537

  • Guest
Re: jBasic OS
« Reply #84 on: June 21, 2010, 01:38:53 am »
here is some code that doesn't seem to be working... can you help?
Code: [Select]
function AB_open(){
tasker_create_task('#THE GAME',AB_Windowz(),null,1000);
// window_create('BUTTONZ','','',100,100,"<input type='button' onclick='AB_Windowz()'></input>");
}
function AB_Windowz(){
if (keyboard_getkey(13)){
window_create('BUTTONZ 2','','',randomInt(100,300),randomInt(100,300),"<input type='button'></input>");
}
// event_notify('The Game');

}

//returns a random integer between a and b
function randomInt(a,b) {
 if (a < 0) {
  b = (b*2)+1;
 }
 return (Math.floor(Math.random()*b)+a)
}


Edit:  W00T, it works.  The error was the function is called "keyboard_getKey" not "keyboard_getkey" (K is capitalized)  also, around the function name at the top "tasker_create_task('#THE GAME',AB_Windowz(),null,1000);"  needs to be "tasker_create_task('#THE GAME','AB_Windowz()',null,1000);"  (quotes around AB_Windowz()  )
« Last Edit: June 21, 2010, 02:06:47 am by _player1537 »

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6265
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: jBasic OS
« Reply #85 on: June 21, 2010, 11:06:20 am »
Yay!
have you come up with any ideas for a full app yet? I'll try to add in a onquit() of somesort soon that you can use.
/e

_player1537

  • Guest
Re: jBasic OS
« Reply #86 on: June 21, 2010, 11:11:15 am »
not sure yet... I'd like to do a game of some sort, or a browser with favorites and all that stuff, but idk.  do you have any ideas?  also, maybe a paint program would be good, how would I get mouse coordinates relative to the window (will that be a command added soon?)

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6265
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: jBasic OS
« Reply #87 on: June 21, 2010, 11:14:41 am »
Hmm, I would go with the game actually, a browser would be way to hard to start off with (trust me I've tried x.x).
actually I do know how, just hold on a sec, I'll tell you.

EDIT: I've made an event handler that will log the mouse X and Y location for you. I'll make some more stuff later. (ie: telling you where it is relative to the current window and such)
« Last Edit: June 21, 2010, 11:55:42 am by Eeems »
/e

_player1537

  • Guest
Re: jBasic OS
« Reply #88 on: June 21, 2010, 12:03:36 pm »
here is my app, it isn't working yet

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6265
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: jBasic OS
« Reply #89 on: June 21, 2010, 07:08:05 pm »
Ok, here is a new version. Changes are as follows:
Launcher icon now toggles visibility, no longer will you need to use the red button to close it. There are some small changes. You can now get the current X and Y location of the mouse by reading from MOUSE_X and MOUSE_Y.
/e