scriptlaunch.py

Created by wperez274

Created on February 01, 2023

2.38 KB

You have to carefully add your own script names in multiple locations in the source code.

Questions?:

wperez274@gmail.com


from math import *
from kandinsky import *
from ion import *
from time import *


bg='white'

row1=100
row2=120
row3=140
row4=160

script_1="BsdSnake"
script_2="Drone316"
script_3="Calculator"
script_4="rgbselect2"



curs_x=0
curs_y=100


def eraseCursor():
    
    global curs_x,curs_y,bg
    
    fill_rect(curs_x,curs_y-1,322,20,bg)


def showScripts():
  
  global row1,row2,row3,row4,curs_xcurs_y,bg

  
  draw_string("BsdSnake",80,row1)
  draw_string("Drone316",80,row2)
  draw_string("Calculator",80,row3)
  draw_string("rgbselect2",80,row4)



  if curs_y==row1:
    draw_string("BsdSnake",80,row1,'black','yellow')

  if curs_y==row2:
    draw_string("Drone316",80,row2,'black','yellow')

  if curs_y==row3:
    draw_string("Calculator",80,row3,'black','yellow')

  if curs_y==row4:
    draw_string("rgbselect2",80,row4,'black','yellow')

  

def launch():
  global row1,row2,row3,row4,curs_x,curs_y,bg

  
  fill_rect(0,0,322,222,bg)
  fill_rect(0,0,322,30,"cyan")
  fill_rect(0,0,322,3,(0,0,255))
  fill_rect(0,30,322,3,(0,0,255))


  while 1:
    showScripts()
    draw_string("Launcher",100,7) 
    fill_rect(curs_x,curs_y-1,322,1,(0,0,0))
    fill_rect(curs_x,curs_y+18,322,1,(0,0,0))


    if keydown(KEY_OK) and curs_y==row1:
      sleep(1.5)

      bg=(0,0,0)
      fill_rect(0,0,322,222,bg)
      draw_string("Loading "+str(script_1)+" ...",70,100,(0,255,0),bg)
      sleep(1.5)
      import bsdsnake

    if keydown(KEY_OK) and curs_y==row2:
      sleep(1.5)

      bg=(0,0,0)
      fill_rect(0,0,322,222,bg)
      draw_string("Loading "+str(script_2)+" ...",70,100,(0,255,0),bg)
      
      sleep(1.5)

      import drone316


    if keydown(KEY_OK) and curs_y==row3:
      sleep(1.5)

      bg=(0,0,0)
      fill_rect(0,0,322,222,bg)
      
      draw_string("Loading "+str(script_3)+" ...",70,100,(0,255,0),bg)
      
      sleep(1.5)
      import calculator

      

    if keydown(KEY_OK) and curs_y==row4:
      sleep(1.5)

      bg=(0,0,0)
      fill_rect(0,0,322,222,bg)
      
      draw_string("Loading "+str(script_4)+" ...",70,100,(0,255,0),bg)
      
      sleep(1.5)
      
      import rgbselect2




  






    if keydown(KEY_UP):
      sleep(0.2)
      eraseCursor()
      curs_y-=20
    if keydown(KEY_DOWN):
      sleep(0.2)
      eraseCursor()
      curs_y+=20





    if curs_y<row1:
      curs_y=row1

    if curs_y>row4:
      curs_y=row4







sleep(0.5)
launch()

During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:

With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our cookies policy.