Skip to content

Instantly share code, notes, and snippets.

## Name: Ruby Bot
## Version: 2.0.2
## Release: 2017-3-29
## Manufacturer: Thomas Tech
class Bot
def initialize(auto)
@todo, @doing, @done, @failed, @log = [], [], [], [], []
@run, @main = false, nil
@cycles, @delay = 0, 0.0
## Name: Dictionary
## Version: 1.1.1
## Release: 2017-4-9
## Manufacturer: Thomas Tech
class Dictionary
def initialize
@dex = []
@data = [] # there can be arrays stored here containing descriptions, part of speech and any aditional entry info, add save/load support later
@thomasjslone
thomasjslone / rom_game.rb
Last active February 21, 2017 20:04
Venture Engine, choose your own adventure, novel based game engine for ruboto on android
$rom_header = ["Game Title",
"0.0.0",
"Author : Full Name",
"Rpg/Adventure/TextBased",
"Janurary 2017",
"XXCID-001CY-X86-USA",
]
@var="helloworld"
def save_file ; ; end
def load_file ; ; end
@thomasjslone
thomasjslone / ossy v1.0.4
Last active February 21, 2017 04:09
Ruby Development Runtime/Debug Environment
#T#;#O#;#P#;#F#
require "rbconfig"
module AddExec ; def exec(r) ; begin ; eval(r.to_s) ; rescue => e ; e.backtrace.join("\n").to_s ; end ; end ; end
OS = "UNKNOWN" ; if RbConfig::CONFIG["host_os"] == "linux" and RbConfig::CONFIG["host_vendor"] == "The Android Project" ; OS = "ANDROID" ; elsif RbConfig::CONFIG["host_os"] == "mingw32" or RbConfig::CONFIG["host_os"] == "mingw64" ; OS = "WINDOWS" ; end
if OS == "ANDROID"
SYS_DIR = ENV["ANDROID_ROOT"].to_s
elsif OS == "WINDOWS"
SYS_DIR == Dir.home.to_s
else
SYS_DIR = Dir.getwd.to_s
@thomasjslone
thomasjslone / bot.rb
Last active February 21, 2017 06:31
better ruby bot model
# @qued = [] @timestamped = [] @threads = [] @done = [] @log = []
#
# - run
# - stop
# - running?
# - state?
# - schedual_task
# - unschedual_task
# - que_task
# - que_file
class Simpleton_Cipher
def initialize ; @chset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,./;'[]-=<>?:\"{}_+)(|\\*&^%$#@!~` \n" ; end
def generate_key ; key = @chset ; key = key.split('').shuffle.join('').to_s ; key ; end
def encode(str,key) ; str.tr(@chset, key) ; end
def decode(str,key) ; str.tr(key, @chset) ; end
end
## NAME: ossy V1.3
## RELEASE: @ 2017.1.27 by TTF INC.
def map_dir(dir) # return an array of two arrays, file and folder paths of every file in given directory and every subdirectory and file with in it
if File.directory?(dir) ; remaining = [dir] ; found_files = [] ; file_size = [] ; found_folders = [] ; until remaining.length == 0 ; cur_dir = remaining[0].to_s ; remaining.delete_at(0) ; cont = Dir.entries(cur_dir) ; cont.delete(".") ; cont.delete("..") ; cont.each do |obj| ; if File.file?(cur_dir.to_s + "/" + obj.to_s) ; found_files << cur_dir.to_s + "/" + obj.to_s ; file_size << File.size?(found_files[-1]) ; elsif File.directory?(cur_dir.to_s + "/" + obj.to_s) ; found_folders << cur_dir.to_s + "/" + obj.to_s ; remaining << cur_dir.to_s + "/" + obj.to_s ; end ; end ; end ; return [file_size,found_files,found_folders] ; else ; "Invalid Directory: " + dir.to_s ; end
end
def splice(str,b,e) #get the point between the first pair instance of tags from the given st
@thomasjslone
thomasjslone / vdr 3.0
Last active January 28, 2017 02:23
vdr with storrage/access modes seperate, multidisk virtual file system w/ encryption and importing/exporting to real file system
class VDrive
## V1.2.2
## Methods:
## - file_exist?(STRING) path returns boolean
## - folder_exist?(STRING) path returns boolean
## - ftype?(STRING) path returns "FILE" , "FOLDER" , "CORRUPTED OBJ"
## - read_file(STRING) path returns string contained in file
## - write_file(STRING,STRING) path, content returns string written, if file does not exist it will be created, otherwise it will be overwritten
## - copy_file(STRING,STRING) path, newpath returns true
## - create_folder(STRING) path returns true
@thomasjslone
thomasjslone / Pokemon Engine GEN1 android ruboto gui
Last active November 25, 2021 20:50
A data engine for gen1 pokemon battles.
#Pokemon Object and Wild Battle data systems, Bag/Items, 3 Pokemon Added, 40 moves and 15 items
# this program is about 60% complete, sorry theres no comments, you will need an android 4-6
# rom to run ruboto irb, which the gui uses(ya its text based you plug an api in if you want im good)
## The structure of this file is Program Componets, Pokemon Data System, Ruboti App GUI wrapper
## so yea you can just chop ruboto out and steal the code but PokeStarter already uses ruby so...
def ivg(o,vn)
o.instance_variable_get(vn.to_s)
end
@thomasjslone
thomasjslone / ossy.rb
Last active September 28, 2016 07:08
ossy android version
class Ossy
def initialize()
@vdrive = ''
@log = ""
@app_name = "Ossy"
@app_version = "0.1.9"
@app_release_date = "2016.11.13"
@app_manufacturer = "Thomas Technical"
@app_description = "Ruby Operating Environment"