mirror of
https://github.com/Xevion/expression-2.git
synced 2025-12-05 23:14:55 -06:00
move all files, massive overhaul of Printer Bank Manager
This commit is contained in:
224
other/fozie's_alarm_system.txt
Normal file
224
other/fozie's_alarm_system.txt
Normal file
@@ -0,0 +1,224 @@
|
|||||||
|
@name Fozie's Alarm System
|
||||||
|
@inputs
|
||||||
|
@outputs
|
||||||
|
@persist [Foz Config Help Allowed]:table
|
||||||
|
@trigger
|
||||||
|
if(first()){
|
||||||
|
#[-----------------------------------------
|
||||||
|
Name: Config
|
||||||
|
-----------------------------------------]#
|
||||||
|
Config = table()
|
||||||
|
|
||||||
|
Config["alarm_sound", string] = "ambient/alarms/apc_alarm_loop1.wav" # This is the sound that'll play when somebody trips the alarm,
|
||||||
|
Config["alarm_dur", number] = 10 # The length that the alarm will sound off
|
||||||
|
|
||||||
|
Config["cmd_min", string] = "min" # This is the command to set the min value for the cube.
|
||||||
|
Config["cmd_max", string] = "max" # This is the command to set the max value for the cube.
|
||||||
|
Config["cmd_show", string] = "show" # This is make the hologram show instead of hide.
|
||||||
|
Config["cmd_hide", string] = "hide" # This is make the hologram hide instead of show.
|
||||||
|
Config["cmd_add", string] = "add" # This will add somebody to the whitelist.
|
||||||
|
Config["cmd_remove", string] = "remove" # This will remove somebody to the whitelist.
|
||||||
|
Config["cmd_help", string] = "help" # This is the command to display the help commands.
|
||||||
|
|
||||||
|
Config["prefix", string] = "!" # This is the prefix for the commands.
|
||||||
|
|
||||||
|
#[-----------------------------------------
|
||||||
|
Name: Setup
|
||||||
|
-----------------------------------------]#
|
||||||
|
function fancyPrint(Text:string){
|
||||||
|
printColor(vec(100, 100, 100), "[", vec(120, 255, 0), "Alarm-System", vec(100, 100, 100), "]: ", vec(255, 255, 255), Text)
|
||||||
|
}
|
||||||
|
|
||||||
|
runOnChat(1)
|
||||||
|
|
||||||
|
holoCreate(1)
|
||||||
|
holoColor(1, vec4(120, 255, 0, 100))
|
||||||
|
holoVisible(1, players(), 0)
|
||||||
|
holoDisableShading(1, 1)
|
||||||
|
|
||||||
|
Foz["min", vector] = vec()
|
||||||
|
Foz["max", vector] = vec()
|
||||||
|
Foz["show", number] = 0 # Bool
|
||||||
|
Foz["alarm", number] = 0 # Bool
|
||||||
|
|
||||||
|
#Allowed[owner():steamID(), number] = 1
|
||||||
|
|
||||||
|
#[-----------------------------------------
|
||||||
|
Name: Commands
|
||||||
|
-----------------------------------------]#
|
||||||
|
Help = table()
|
||||||
|
|
||||||
|
Help[Config["prefix", string] + Config["cmd_min", string], string] = "This will set the min value for the detection cube."
|
||||||
|
Help[Config["prefix", string] + Config["cmd_max", string], string] = "This will set the max value for the detection cube."
|
||||||
|
Help[Config["prefix", string] + Config["cmd_show", string], string] = "This show the hologram."
|
||||||
|
Help[Config["prefix", string] + Config["cmd_hide", string], string] = "This hide the hologram."
|
||||||
|
Help[Config["prefix", string] + Config["cmd_add", string], string] = "This will add somebody to your whitelist."
|
||||||
|
Help[Config["prefix", string] + Config["cmd_remove", string], string] = "This will remove somebody from your whitelist."
|
||||||
|
Help[Config["prefix", string] + Config["cmd_help", string], string] = "This will returtn a list of commands."
|
||||||
|
}
|
||||||
|
interval(100)
|
||||||
|
|
||||||
|
#[-----------------------------------------
|
||||||
|
Name: Chat
|
||||||
|
-----------------------------------------]#
|
||||||
|
|
||||||
|
if(chatClk(owner())){
|
||||||
|
local Ex = lastSaid():explode(" ")
|
||||||
|
|
||||||
|
if(Ex[1, string] == Config["prefix", string] + Config["cmd_help", string]){
|
||||||
|
hideChat(1)
|
||||||
|
|
||||||
|
fancyPrint("Here's a list of commands.")
|
||||||
|
|
||||||
|
foreach(K, V:string = Help){
|
||||||
|
fancyPrint(K + " - " + V)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(Ex[1, string] == Config["prefix", string] + Config["cmd_min", string]){
|
||||||
|
hideChat(1)
|
||||||
|
|
||||||
|
Foz["min", vector] = owner():aimPos()
|
||||||
|
|
||||||
|
fancyPrint("Set the minimum value to: " + round(Foz["min", vector], 2))
|
||||||
|
}
|
||||||
|
|
||||||
|
if(Ex[1, string] == Config["prefix", string] + Config["cmd_max", string]){
|
||||||
|
hideChat(1)
|
||||||
|
|
||||||
|
Foz["max", vector] = owner():aimPos()
|
||||||
|
|
||||||
|
fancyPrint("Set the maximum value to: " + round(Foz["max", vector], 2))
|
||||||
|
}
|
||||||
|
|
||||||
|
if(Ex[1, string] == Config["prefix", string] + Config["cmd_show", string]){
|
||||||
|
hideChat(1)
|
||||||
|
|
||||||
|
if(Foz["show", number]){
|
||||||
|
fancyPrint("Already showing the hologram. Make sure that the min and max values are set!")
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
Foz["show", number] = 1
|
||||||
|
fancyPrint("Showing the hologram. (Note, the hologram will not show if the min or max value is not set.)")
|
||||||
|
|
||||||
|
holoVisible(1, players(), Foz["show", number])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(Ex[1, string] == Config["prefix", string] + Config["cmd_hide", string]){
|
||||||
|
hideChat(1)
|
||||||
|
|
||||||
|
if(!Foz["show", number]){
|
||||||
|
fancyPrint("Already hiding the hologram. Make sure that the min and max values are set!")
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
Foz["show", number] = 0
|
||||||
|
fancyPrint("Hiding the hologram. (Note, the hologram will not show if the min or max value is not set.)")
|
||||||
|
|
||||||
|
holoVisible(1, players(), Foz["show", number])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(Ex[1, string] == Config["prefix", string] + Config["cmd_add", string]){
|
||||||
|
hideChat(1)
|
||||||
|
|
||||||
|
local Ply = findPlayerByName(Ex[2, string])
|
||||||
|
|
||||||
|
if(Ply:isPlayer()){
|
||||||
|
if(Allowed[Ply:steamID(), number]){
|
||||||
|
fancyPrint(Ply:name() + " is already on the whitelist!")
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
fancyPrint("Added " + Ply:name() + " to the whitelist.")
|
||||||
|
Allowed[Ply:steamID(), number] = 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
fancyPrint("Sorry, but I couldn't find player: " + Ex[2, string])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(Ex[1, string] == Config["prefix", string] + Config["cmd_remove", string]){
|
||||||
|
hideChat(1)
|
||||||
|
|
||||||
|
local Ply = findPlayerByName(Ex[2, string])
|
||||||
|
|
||||||
|
if(Ply:isPlayer()){
|
||||||
|
if(!Allowed[Ply:steamID(), number]){
|
||||||
|
fancyPrint(Ply:name() + " isn't on the whitelist!")
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
fancyPrint("Removed " + Ply:name() + " from the whitelist.")
|
||||||
|
Allowed[Ply:steamID(), number] = 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
fancyPrint("Sorry, but I couldn't find player: " + Ex[2, string])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[-----------------------------------------
|
||||||
|
Name: Hologram
|
||||||
|
-----------------------------------------]#
|
||||||
|
if(changed(Foz["min", vector]) & Foz["min", vector] & Foz["max", vector] | changed(Foz["max", vector]) & Foz["min", vector] & Foz["max", vector]){
|
||||||
|
local Scale = (Foz["min", vector] - Foz["max", vector])
|
||||||
|
|
||||||
|
holoScaleUnits(1, Scale)
|
||||||
|
holoPos(1, (Foz["min", vector] + Foz["max", vector]) / 2)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[-----------------------------------------
|
||||||
|
Name: Detection
|
||||||
|
-----------------------------------------]#
|
||||||
|
if(Foz["min", vector] & Foz["max", vector]){
|
||||||
|
findIncludeClass("Player")
|
||||||
|
findInBox(Foz["min", vector], Foz["max", vector])
|
||||||
|
local Ents = findToArray()
|
||||||
|
|
||||||
|
local Intruders = table()
|
||||||
|
|
||||||
|
foreach(K, V:entity = Ents){
|
||||||
|
if(!Allowed[V:steamID(), number] & !Foz["alarm", number]){
|
||||||
|
Intruders:pushEntity(V)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!Foz["alarm", number]){
|
||||||
|
local Count = Intruders:count()
|
||||||
|
|
||||||
|
local Str = ""
|
||||||
|
|
||||||
|
for(I=1, Count){
|
||||||
|
local V = Intruders[I, entity]
|
||||||
|
|
||||||
|
if(I == Count){
|
||||||
|
Str = Str + V:name()
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
Str = Str + V:name() + ", "
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(Count >= 1){
|
||||||
|
Foz["alarm", number] = 1
|
||||||
|
|
||||||
|
fancyPrint("Alarm was tripped by " + Str + ".")
|
||||||
|
|
||||||
|
soundPlay(1, Config["alarm_dur", number], Config["alarm_sound", string])
|
||||||
|
|
||||||
|
timer("alarm_on", Config["alarm_dur", number] * 1000)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(clk("alarm_on")){
|
||||||
|
Foz["alarm", number] = 0
|
||||||
|
}
|
||||||
|
#[-----------------------------------------
|
||||||
|
Made By Fozie!
|
||||||
|
|
||||||
|
SteamID: STEAM_0:0:226129070
|
||||||
|
Profile: http://steamcommunity.com/profiles/76561198412523868
|
||||||
|
Discord: Fozie#5014
|
||||||
|
-----------------------------------------]#
|
||||||
317
other/radio_v.3.txt
Normal file
317
other/radio_v.3.txt
Normal file
@@ -0,0 +1,317 @@
|
|||||||
|
@name Radio v.3
|
||||||
|
@inputs
|
||||||
|
@outputs Length
|
||||||
|
@persist Length Mode Temp Count Holo:entity [USE_KEY OPEN_MENU_KEY]:string Menu OO:entity Test:vector Holo_Aim:entity Key Active [TempVec]:vector [Inside Outside Hover]:vector4
|
||||||
|
@persist RadioSender:array
|
||||||
|
@trigger none
|
||||||
|
|
||||||
|
interval(140)
|
||||||
|
runOnChat(1)
|
||||||
|
runOnLast(1)
|
||||||
|
|
||||||
|
E = entity()
|
||||||
|
Ply = players()
|
||||||
|
O = owner()
|
||||||
|
|
||||||
|
Last = O:lastSaid():explode(" ")
|
||||||
|
|
||||||
|
########################################################################################################################################################################
|
||||||
|
|
||||||
|
if(first()){
|
||||||
|
|
||||||
|
|
||||||
|
Menu = 0
|
||||||
|
|
||||||
|
#Colors
|
||||||
|
Inside = vec4(0,0,0,255)
|
||||||
|
Outside = vec4(255,255,255,255)
|
||||||
|
Hover = vec4(200,200,200,255)
|
||||||
|
|
||||||
|
#Settings
|
||||||
|
Mode = 1 # 1 = The Menu Will Follow You || 2 = The Menu Will Stay Where You Opened It
|
||||||
|
Model = "models/sprops/geometry/fhex_18.mdl" #models/sprops/geometry/fhex_18.mdl - octagon
|
||||||
|
Count = 4 # 1 - 9
|
||||||
|
TMat = "models/debug/debugwhite" #Material
|
||||||
|
Radius = 16.75 #Radius
|
||||||
|
Scale_Mul = 0.6 #Scaling Mul
|
||||||
|
Outline = 1.02#1.05 #outline size
|
||||||
|
USE_KEY = "E" #Use key
|
||||||
|
OPEN_MENU_KEY = "g" #Use key
|
||||||
|
Rotation = 180 #Rotates outerprops around the center
|
||||||
|
Center = 1 #1 = holo in center || 0 = no holo
|
||||||
|
CenterS = 1 #The size of the center prop
|
||||||
|
|
||||||
|
|
||||||
|
Scaling = vec(1.5,0.3,1.5)*Scale_Mul
|
||||||
|
Center_Scaling = Scaling*CenterS
|
||||||
|
Angle_Offset = ang(0,90,0)
|
||||||
|
|
||||||
|
RadioSender[1,string] = "http://stream01.iloveradio.de/iloveradio1.mp3"
|
||||||
|
RadioSender[2,string] = "http://stream.sunshine-live.de/live/mp3-192/Webradio-Player/"
|
||||||
|
RadioSender[3,string] = "http://mp3.ad.mdn.nacamar.net/ps-radiogalaxy/livestream.mp3"
|
||||||
|
RadioSender[4,string] = "http://online.radiorecord.ru:8102/club_128"
|
||||||
|
|
||||||
|
streamVolume(1,1000)
|
||||||
|
streamRadius(1,1000)
|
||||||
|
streamDisable3D(1)
|
||||||
|
|
||||||
|
entity():propShadow(0)
|
||||||
|
entity():propNotSolid(1)
|
||||||
|
entity():propDraw(0)
|
||||||
|
|
||||||
|
function entity c(Index:number,Posi:vector,Scale:vector,Angle:angle,Colo:vector,Model:string,Material:string,Parent:entity,Alpha:number){
|
||||||
|
holoCreate(Index) holoPos(Index,Posi) holoScale(Index,Scale) holoAng(Index,Angle) holoColor(Index,Colo) holoModel(Index,Model) holoMaterial(Index,Material)
|
||||||
|
holoParent(Index,Parent) holoAlpha(Index,Alpha)
|
||||||
|
return holoEntity(Index)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function number chat(N,S:string){
|
||||||
|
return (chatClk(owner())&owner():lastSaid():explode(" "):string(N)==S)
|
||||||
|
}
|
||||||
|
|
||||||
|
function printC(S:string){
|
||||||
|
printColor(vec(255),"[ ",vec(255,0,0),"E2",vec(255)," ] ",vec(255,255,0),S)
|
||||||
|
}
|
||||||
|
|
||||||
|
function opri(Message2:string,ColorM2:vector){
|
||||||
|
printColor(vec(255),"[",vec(255,0,0),"RDv3",vec(255),"] ",vec(255,255,0),ColorM2,Message2)
|
||||||
|
}
|
||||||
|
|
||||||
|
function string formatname(URL:string) {
|
||||||
|
local Path = URL:explode("//")
|
||||||
|
local File = Path[Path:count(), string]:replace(".mp3", " ")
|
||||||
|
local File = File:right(File:length()-0)
|
||||||
|
|
||||||
|
return File:replace("%20", " ")
|
||||||
|
}
|
||||||
|
|
||||||
|
function streamPlay(Ent:entity,Index:number,SoundArt:array,SoundName:string,SoundN:number) {
|
||||||
|
Ent:streamStart(Index,SoundArt[SoundN,string],1000)
|
||||||
|
opri(SoundName+" Nr."+SoundN+" ["+formatname(SoundArt[SoundN,string])+"]",vec(255,255,0))
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function void drawText(String:string,Index,Holo:entity,Scale,Case){
|
||||||
|
|
||||||
|
c(1000,Holo:pos()+vec(10,0,0),vec(1,0.1,3),ang(90,0,0),vec(0),"","",noentity(),255)
|
||||||
|
holoDisableShading(1000,1)
|
||||||
|
c(1001,Holo:pos()+vec(10,0,0),-vec(1.03,0.12,3.03),ang(90,0,0),vec(0),"","",holoEntity(1000),255)
|
||||||
|
holoColor(1001,Outside)
|
||||||
|
holoDisableShading(1001,1)
|
||||||
|
|
||||||
|
|
||||||
|
String = String:replace(" ","")
|
||||||
|
String = String:sub(1,10)
|
||||||
|
Explode = String:explode("")
|
||||||
|
Length = Explode:count()
|
||||||
|
|
||||||
|
for(I=1,Length){
|
||||||
|
if(Case==0){
|
||||||
|
c(Index+I,holoEntity(1000):pos() +vec(I*3.2 - 19,0,0),vec(Scale)+vec(0,0.4,0),ang(0,180,0),vec(0),"models/sprops/misc/alphanum/alphanum_l_"+Explode[I,string]+".mdl","models/debug/debugwhite",holoEntity(1000),255)
|
||||||
|
}
|
||||||
|
elseif(Case==1){
|
||||||
|
c(Index+I,holoEntity(1000):pos() +vec(I*3.2 - 19,0,0),vec(Scale)+vec(0,0.4,0),ang(0,180,0),vec(0),"models/sprops/misc/alphanum/alphanum_"+Explode[I,string]+".mdl","models/debug/debugwhite",holoEntity(1000),255)
|
||||||
|
}
|
||||||
|
holoDisableShading(Index+I,1)
|
||||||
|
holoColor(Index+I,Outside)
|
||||||
|
}
|
||||||
|
holoPos(1000,Holo:pos()-Holo:right()*45)
|
||||||
|
#holoAng(1000,Holo:angles()+ang(10,60,0))
|
||||||
|
holoAng(1000,ang(60,90,0) + (owner():pos() - holoEntity(1000):pos()):toAngle())
|
||||||
|
holoParent(1000,Holo)
|
||||||
|
}
|
||||||
|
|
||||||
|
function void hideText(Index){
|
||||||
|
|
||||||
|
holoPos(1000,vec(0))
|
||||||
|
for(I=1,Length){
|
||||||
|
holoAlpha(Index+I,0)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function void button(Button){
|
||||||
|
|
||||||
|
switch(Button){
|
||||||
|
|
||||||
|
#Button 1 is pressed
|
||||||
|
case 1,
|
||||||
|
hideText(500)
|
||||||
|
drawText("iloveradio",500,holoEntity(900),0.3,1)#String Text, Starting Holo Index, Base Menu Holo, Scale, Lower-Upper Case.
|
||||||
|
streamPlay(holoEntity(12687),1,RadioSender,"Radio",1)
|
||||||
|
break
|
||||||
|
|
||||||
|
#Button 2 is pressed
|
||||||
|
case 2,
|
||||||
|
hideText(500)
|
||||||
|
drawText("sunshine",500,holoEntity(900),0.3,1)#String Text, Starting Holo Index, Base Menu Holo, Scale, Lower-Upper Case.
|
||||||
|
streamPlay(holoEntity(12687),1,RadioSender,"Radio",2)
|
||||||
|
break
|
||||||
|
|
||||||
|
#Button 3 is pressed
|
||||||
|
case 3,
|
||||||
|
hideText(500)
|
||||||
|
drawText("radiogalaxy",500,holoEntity(900),0.3,1)#String Text, Starting Holo Index, Base Menu Holo, Scale, Lower-Upper Case.
|
||||||
|
streamPlay(holoEntity(12687),1,RadioSender,"Radio",3)
|
||||||
|
break
|
||||||
|
|
||||||
|
#Button 4 is pressed
|
||||||
|
case 4,
|
||||||
|
hideText(500)
|
||||||
|
drawText("club 128",500,holoEntity(900),0.3,1)#String Text, Starting Holo Index, Base Menu Holo, Scale, Lower-Upper Case.
|
||||||
|
streamPlay(holoEntity(12687),1,RadioSender,"Radio",4)
|
||||||
|
break
|
||||||
|
|
||||||
|
#Button 5 is pressed
|
||||||
|
case 5,
|
||||||
|
hideText(500)
|
||||||
|
#drawText("5",500,holoEntity(900),0.3,1)#String Text, Starting Holo Index, Base Menu Holo, Scale, Lower-Upper Case.
|
||||||
|
streamStop(1)
|
||||||
|
break
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function holoMenu(){
|
||||||
|
|
||||||
|
if(first()){
|
||||||
|
c(0,vec(0),vec(1),ang(0),vec(255),"models/sprops/cuboids/height12/size_1/cube_12x12x12.mdl","",noentity(),255)
|
||||||
|
holoDisableShading(0,1)
|
||||||
|
holoScaleUnits(0,vec(0))
|
||||||
|
|
||||||
|
c(12687,owner():shootPos()+vec(0,0,10),vec(0),ang(90,0,0),vec(0),"","",owner(),0)
|
||||||
|
|
||||||
|
#Menu
|
||||||
|
HCenter = E:pos() + vec(0,0,60) #+ owner():forward()*50
|
||||||
|
c(900,HCenter,vec(1),ang(90,0,0),vec(255),"models/sprops/cuboids/height12/size_1/cube_12x12x12.mdl",TMat,noentity(),0)
|
||||||
|
holoScaleUnits(900,vec(1))
|
||||||
|
|
||||||
|
if(Center){
|
||||||
|
c(200+Count+1,HCenter,Center_Scaling,Angle_Offset,vec(0),Model,TMat,holoEntity(900),255) holoColor(200+Count+1,Inside)
|
||||||
|
c(101,HCenter,-Center_Scaling*Outline,Angle_Offset,vec(0),Model,TMat,holoEntity(900),255) holoColor(101,Outside)
|
||||||
|
holoDisableShading(200+Count+1,1) holoDisableShading(101,1)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#holoScale(0, vec(1,1,0.1))
|
||||||
|
#holoAng(0, entity():toWorld(ang(-40,0,0)))
|
||||||
|
for(I=201,200+Count){
|
||||||
|
Temp = Temp + 1
|
||||||
|
#print(I)
|
||||||
|
local TempVec = Radius * vec(cos(I*(360/Count)),sin(I*(360/Count)),0):rotate(holoEntity(900):angles()+ang(Rotation,-90,-90)) + holoEntity(900):pos()
|
||||||
|
|
||||||
|
c(I,TempVec,Scaling,Angle_Offset,vec(0),Model,TMat,holoEntity(900),255)
|
||||||
|
holoColor(I,Inside)
|
||||||
|
|
||||||
|
c(I+50,holoEntity(I):pos(),-Scaling*Outline,holoEntity(I):angles(),vec(0),holoEntity(I):model(),TMat,holoEntity(I),255)
|
||||||
|
holoColor(I+50,Outside)
|
||||||
|
holoDisableShading(I+50,1)
|
||||||
|
|
||||||
|
String = "models/sprops/misc/alphanum/alphanum_"+(Temp):toString()+".mdl"
|
||||||
|
#print(Temp)0
|
||||||
|
#print(String)
|
||||||
|
holoCreate(I+100,holoEntity(I):pos(),vec(0.7),holoEntity(I):angles()+ang(0,180,0),vec(255),"models/sprops/misc/alphanum/alphanum_"+Temp:toString()+".mdl")
|
||||||
|
holoMaterial(I+100,TMat)
|
||||||
|
holoDisableShading(I+100,1)
|
||||||
|
holoParent(I+100,I)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
rangerPersist(1)
|
||||||
|
rangerFilter(owner())
|
||||||
|
Holo = holoEntity(900)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
local Key = owner():keyPressed(OPEN_MENU_KEY)
|
||||||
|
if(changed(Key) & Key){
|
||||||
|
Active = !Active
|
||||||
|
if(!Active){
|
||||||
|
holoPos(900,vec(0))
|
||||||
|
Counter = 0
|
||||||
|
}
|
||||||
|
TempVec = owner():pos() + vec(0,0,50) + owner():forward()*80
|
||||||
|
TempAng = holoEntity(900):angles()
|
||||||
|
}
|
||||||
|
|
||||||
|
if(changed(Active) & Active == 1){
|
||||||
|
Aim=rangerOffset(100, owner():shootPos(), owner():eye())
|
||||||
|
holoPos(900, Aim:position())
|
||||||
|
}
|
||||||
|
|
||||||
|
if(Active){
|
||||||
|
|
||||||
|
if(Mode==1){
|
||||||
|
|
||||||
|
holoPos(900,owner():pos() + vec(0,0,50) + owner():forward()*80)
|
||||||
|
holoAng(900,ang(45,0,0) + (owner():pos() - holoEntity(900):pos()):toAngle())
|
||||||
|
#holoAng(1000,ang(0,0,0) + (owner():pos() - holoEntity(900):pos()):toAngle())
|
||||||
|
holoAng(0,holoEntity(900):angles())
|
||||||
|
|
||||||
|
}elseif(Mode==2){
|
||||||
|
holoPos(900,TempVec)
|
||||||
|
holoAng(900,ang(45,0,0) + (owner():pos() - holoEntity(900):pos()):toAngle())
|
||||||
|
#holoAng(1000,ang(60,90,0) + (owner():pos() - holoEntity(1000):pos()):toAngle())
|
||||||
|
holoAng(0,holoEntity(900):angles())
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ShootPos = owner():shootPos()
|
||||||
|
EyeDir = owner():eye()
|
||||||
|
|
||||||
|
#How does line-plane intersection work?
|
||||||
|
PlanePoint = Holo:pos() #Get a point in the plane
|
||||||
|
Normal = Holo:up() #Get the normal (a vector perpendicular to the surface) of the plane
|
||||||
|
LinePoint1 = ShootPos #Get a point on the line
|
||||||
|
LinePoint2 = ShootPos+EyeDir #Get a point on the line "after" point 1#
|
||||||
|
X = (Normal:dot(PlanePoint-LinePoint1))/(Normal:dot(LinePoint2-LinePoint1)) #Not really sure how, but it returns how many times the distance from point 1 to point 2 you need to go from point 1 to reach the intersection
|
||||||
|
Vec = LinePoint1+X*(LinePoint2-LinePoint1) #Get the intersections position using f(X) = LinePoint1+X*(LinePoint2-LinePoint1)
|
||||||
|
#
|
||||||
|
|
||||||
|
holoPos(0,Vec)
|
||||||
|
|
||||||
|
for(I=201,200+Count+1){
|
||||||
|
if(Vec:distance(holoEntity(I):pos())<8){
|
||||||
|
holoColor(I,Hover)
|
||||||
|
if(changed(owner():keyPressed(USE_KEY))&owner():keyPressed(USE_KEY)){
|
||||||
|
button(I-200)
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
holoColor(I,Inside)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}else{
|
||||||
|
holoPos(0,vec(0))
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################################################################################################################
|
||||||
|
|
||||||
|
function runE2(){
|
||||||
|
|
||||||
|
holoMenu()
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(last()){ propDeleteAll() streamStop(1) }
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################################################################################################################
|
||||||
|
|
||||||
|
if(opcounter()<(softQuota()) & perf()){
|
||||||
|
runE2()
|
||||||
|
}
|
||||||
|
|
||||||
44
other/silenthillalarm_by_fatality.txt
Normal file
44
other/silenthillalarm_by_fatality.txt
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
@name SilentHillAlarm By Fatality
|
||||||
|
@outputs Input Text:string AlarmColor:vector BackgroundTextColor:vector LightStatus:number
|
||||||
|
@persist LightStatus:number
|
||||||
|
|
||||||
|
interval(1000)
|
||||||
|
runOnChat(1)
|
||||||
|
|
||||||
|
if(first()) {
|
||||||
|
streamRadius(1,1000)
|
||||||
|
streamVolume(1,1000)
|
||||||
|
streamDisable3D(1)
|
||||||
|
Mode = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
if(Mode == 1) {
|
||||||
|
LightStatus++
|
||||||
|
if(LightStatus == 2) {
|
||||||
|
LightStatus = 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(chatClk(owner())) {
|
||||||
|
LS = lastSaid():lower():explode(" ")
|
||||||
|
if(LS[1, string] == "!sirenon") {
|
||||||
|
if(Mode == 0) {
|
||||||
|
#Link = "https://www.dropbox.com/s/rzm1pvto4pi71s8/SilentHillSirenFinal.mp3?dl=1"
|
||||||
|
Link = "https://www.dropbox.com/s/7l6v3nync6cq575/oki doki boomer.mp3?dl=0&raw=1"
|
||||||
|
entity():streamStart(1,Link)
|
||||||
|
|
||||||
|
Input = 1
|
||||||
|
Text = "Warning: Breach Detected!"
|
||||||
|
AlarmColor = vec(255,0,0)
|
||||||
|
BackgroundTextColor = vec(0,0,0)
|
||||||
|
}
|
||||||
|
} elseif(LS[1, string] == "!sirenoff") {
|
||||||
|
if(Mode == 1) {
|
||||||
|
streamStop(1)
|
||||||
|
Input = 0
|
||||||
|
Text = "Status: Green"
|
||||||
|
AlarmColor = vec(0,255,0)
|
||||||
|
BackgroundTextColor = vec(255,255,255)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,141 +0,0 @@
|
|||||||
@name Printer Bank Manager V1
|
|
||||||
@inputs EGP:wirelink
|
|
||||||
@persist PRINTER_COSTS:table PRINTER_TYPE:string Selected:array
|
|
||||||
@trigger
|
|
||||||
|
|
||||||
# Chat Commands
|
|
||||||
# &tax <float> - Moves the tax to a certain level. 1.00 = +100%. Can be negative.
|
|
||||||
# &clearinv - Forcefully clear selected items
|
|
||||||
# &cleargui - Move to main menu
|
|
||||||
# &clearall - clearinv & cleargui combined
|
|
||||||
# &time - Set the current contract time (in hours).
|
|
||||||
# &sumcost - Print the raw cost of buying the selected items.
|
|
||||||
# &sumtax - Print the inflicted payment upon buying the select items.
|
|
||||||
# &sumcontract - The amount of money paid upon contract signature.
|
|
||||||
|
|
||||||
# Begin program intervals, timers etc.
|
|
||||||
runOnChat(1)
|
|
||||||
|
|
||||||
# Selected - An array of strings holding the names
|
|
||||||
|
|
||||||
# Constants and other first-only executions
|
|
||||||
if (first()) {
|
|
||||||
EGP:egpClear() # Clear in-case E2 is repasted
|
|
||||||
PRINTER_TYPE = "none" # holds the changing menu type the user is currently on
|
|
||||||
PRINTER_COSTS = table() # holds the constant costs of printers
|
|
||||||
PRINTER_MAX = table() # holds constants concerning the maximum of each printer
|
|
||||||
PRINTER_UPGRADE = table()
|
|
||||||
|
|
||||||
### Configure printer costs (bitminer only)
|
|
||||||
# SERVER 7 x CPU ($2,000) = $14,000
|
|
||||||
# S2 -
|
|
||||||
# S1 - 3 Cores ($50,000), 7 CPUs ($2,000)
|
|
||||||
|
|
||||||
## Configure printer price costs here in-case they change
|
|
||||||
# Bitminers
|
|
||||||
PRINTER_COSTS["bitminer_rack", number] = 100000
|
|
||||||
PRINTER_COSTS["bitminer_server", number] = 50000
|
|
||||||
PRINTER_COSTS["bitminer_s2", number] = 25000
|
|
||||||
PRINTER_COSTS["bitminer_s1", number] = 5000
|
|
||||||
PRINTER_COSTS["bitminer_extensionlead", number] = 500
|
|
||||||
PRINTER_COSTS["bitminer_powerlead", number] = 500
|
|
||||||
PRINTER_COSTS["bitminer_generator", number] = 6000
|
|
||||||
PRINTER_COSTS["bitminer_fueltank", number] = 10000
|
|
||||||
PRINTER_COSTS["bitminer_fuelline", number] = 1500
|
|
||||||
|
|
||||||
# Moneyprinters
|
|
||||||
PRINTER_COSTS["printer_sapphire", number] = 20000
|
|
||||||
PRINTER_COSTS["printer_emerald", number] = 45000
|
|
||||||
PRINTER_COSTS["printer_ruby", number] = 60000
|
|
||||||
PRINTER_COSTS["printer_diamond", number] = 85000
|
|
||||||
PRINTER_COSTS["printer_platinum", number] = 150000
|
|
||||||
PRINTER_COSTS["printer_god", number] = 350000
|
|
||||||
|
|
||||||
## Configure printer maximums here in-case they change
|
|
||||||
# Bitminers
|
|
||||||
PRINTER_MAX["bitminer_rack", number] = 2
|
|
||||||
PRINTER_MAX["bitminer_server", number] = 16
|
|
||||||
PRINTER_MAX["bitminer_s2", number] = 4
|
|
||||||
PRINTER_MAX["bitminer_s1", number] = 4
|
|
||||||
PRINTER_MAX["bitminer_extensionlead", number] = 8
|
|
||||||
PRINTER_MAX["bitminer_powerlead", number] = 10
|
|
||||||
PRINTER_MAX["bitminer_generator", number] = 3
|
|
||||||
PRINTER_MAX["bitminer_fueltank", number] = 2
|
|
||||||
PRINTER_MAX["bitminer_fuelline", number] = 2
|
|
||||||
|
|
||||||
# Moneyprinters
|
|
||||||
PRINTER_MAX["printer_sapphire", number] = 2
|
|
||||||
PRINTER_MAX["printer_emerald", number] = 2
|
|
||||||
PRINTER_MAX["printer_ruby", number] = 2
|
|
||||||
PRINTER_MAX["printer_diamond", number] = 2
|
|
||||||
PRINTER_MAX["printer_platinum", number] = 1
|
|
||||||
PRINTER_MAX["printer_god", number] = 1
|
|
||||||
}
|
|
||||||
|
|
||||||
# Graphics Drawing
|
|
||||||
# Main Menu
|
|
||||||
function main_menu(){
|
|
||||||
### Center Gradients
|
|
||||||
## Top Portion Gradient
|
|
||||||
EGP:egpBox(1,vec2(256,256),vec2(520,520))
|
|
||||||
EGP:egpMaterial(1,"gui/gradient_up")
|
|
||||||
EGP:egpColor(1,vec(42,200,240))
|
|
||||||
## Bottom Portion Gradient
|
|
||||||
EGP:egpBox(2,vec2(256,256),vec2(520,520))
|
|
||||||
EGP:egpMaterial(2,"gui/gradient_down")
|
|
||||||
EGP:egpColor(2,vec(1,70,90))
|
|
||||||
### Right/Left Lighter Boxes
|
|
||||||
## Left
|
|
||||||
EGP:egpBox(3,vec2(15,256),vec2(35,550))
|
|
||||||
EGP:egpColor(3,vec(1,110,140))
|
|
||||||
## Right
|
|
||||||
EGP:egpBox(4,vec2(495,256),vec2(35,550))
|
|
||||||
EGP:egpColor(4,vec(1,110,140))
|
|
||||||
### Top/Bottom Underlying Dark Cyan
|
|
||||||
## Bottom
|
|
||||||
EGP:egpBox(5,vec2(256,495),vec2(450,35))
|
|
||||||
EGP:egpColor(5,vec(1,110,140))
|
|
||||||
## Top
|
|
||||||
EGP:egpBox(6,vec2(256,15),vec2(450,35))
|
|
||||||
EGP:egpColor(6,vec(1,110,140))
|
|
||||||
### Top & Bottom Ultralight Trim Corners
|
|
||||||
## Top
|
|
||||||
EGP:egpBox(7,vec2(256,18),vec2(485,5))
|
|
||||||
EGP:egpColor(7,vec(1,200,255))
|
|
||||||
## Bottom
|
|
||||||
EGP:egpBox(8,vec2(256,493),vec2(485,5))
|
|
||||||
EGP:egpColor(8,vec(1,200,255))
|
|
||||||
### Left and Right Vertical Trim
|
|
||||||
## Right
|
|
||||||
EGP:egpBox(9,vec2(496,256),vec2(5,478))
|
|
||||||
EGP:egpColor(9,vec(1,200,255))
|
|
||||||
## Left
|
|
||||||
EGP:egpBox(10,vec2(16,256),vec2(5,478))
|
|
||||||
EGP:egpColor(10,vec(1,200,255))
|
|
||||||
### Top Title Text Box
|
|
||||||
## Rounded Box w/ Shadow
|
|
||||||
EGP:egpRoundedBox(11,vec2(254,20),vec2(440,40))
|
|
||||||
EGP:egpColor(11,vec(1,110,140))
|
|
||||||
# Shadow Element
|
|
||||||
EGP:egpRoundedBox(12,vec2(254,20),vec2(434,34))
|
|
||||||
EGP:egpColor(12,vec(1,200,255))
|
|
||||||
## Text
|
|
||||||
EGP:egpText(15,owner():name():left(13)+"'s Printer Bank",vec2(256,20))
|
|
||||||
EGP:egpFont(15,"coolvetica",35)
|
|
||||||
EGP:egpAlign(15,1,1)
|
|
||||||
EGP:egpColor(15,vec(0,0,0))
|
|
||||||
### Bottom Subtitle Text Box
|
|
||||||
## Rounded Box w/ Shadow
|
|
||||||
EGP:egpRoundedBox(13,vec2(254,490),vec2(440,40))
|
|
||||||
EGP:egpColor(13,vec(1,110,140))
|
|
||||||
# Shadow Element
|
|
||||||
EGP:egpRoundedBox(14,vec2(254,490),vec2(434,34))
|
|
||||||
EGP:egpColor(14,vec(1,200,255))
|
|
||||||
## Text
|
|
||||||
EGP:egpText(16,"Select a Type of Printer to Sell",vec2(255,490))
|
|
||||||
EGP:egpFont(16,"coolvetica",26)
|
|
||||||
EGP:egpAlign(16,1,1)
|
|
||||||
EGP:egpColor(16,vec(0,0,0))
|
|
||||||
}
|
|
||||||
|
|
||||||
main_menu()
|
|
||||||
11
xevion/other/persistent_loop_test.txt
Normal file
11
xevion/other/persistent_loop_test.txt
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
@name Persistent Loop Test
|
||||||
|
@persist X:number
|
||||||
|
|
||||||
|
interval(500)
|
||||||
|
if(first()){X = 0}
|
||||||
|
else {
|
||||||
|
X++
|
||||||
|
if(X == 2) {
|
||||||
|
X = 0
|
||||||
|
}
|
||||||
|
}
|
||||||
36
xevion/projects/AFK Bypass/afk_warning_e2_by_xevion.txt
Normal file
36
xevion/projects/AFK Bypass/afk_warning_e2_by_xevion.txt
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
@name AFK Bypass E2 by Xevion
|
||||||
|
@persist Position:vector LastTime:number AutoDisable:number Direction:number
|
||||||
|
|
||||||
|
interval(100)
|
||||||
|
|
||||||
|
local Time = time()
|
||||||
|
local NewPosition = owner():pos()
|
||||||
|
|
||||||
|
# Setup constants
|
||||||
|
if(first()) {
|
||||||
|
Position = NewPosition # Last position when a difference in position was detected
|
||||||
|
LastTime = Time # Last time a difference in position was detected
|
||||||
|
AutoDisableForwards = 0 # 1 if should run -forward or -backward next tick
|
||||||
|
Direction = 1 # current/next walking direction is backwards, 0 is backward, 1 is forward
|
||||||
|
}
|
||||||
|
|
||||||
|
# if movement command executed, must disable and switch directions
|
||||||
|
if(AutoDisable) {
|
||||||
|
Direction ? concmd("-forward") : concmd("-back")
|
||||||
|
AutoDisable = !AutoDisable
|
||||||
|
Direction = !Direction
|
||||||
|
}
|
||||||
|
|
||||||
|
# If movement detected
|
||||||
|
if(Position:distance(NewPosition) > 1) {
|
||||||
|
LastTime = Time
|
||||||
|
Position = NewPosition
|
||||||
|
} else {
|
||||||
|
local Difference = Time - LastTime
|
||||||
|
# If 8 minutes without movement
|
||||||
|
if(Difference > (60 * 8)) {
|
||||||
|
print("Automatically moving to disable AFK timer")
|
||||||
|
Direction ? concmd("+forward") : concmd("+back")
|
||||||
|
AutoDisable = 1
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,14 +1,15 @@
|
|||||||
@name YouTube MP3 Soundplayer V1
|
@name YouTube MP3 Soundplayer V1
|
||||||
@inputs
|
@inputs
|
||||||
@outputs
|
@outputs
|
||||||
@persist Radio:entity
|
@persist Radio:entity URL:string
|
||||||
@trigger
|
@trigger
|
||||||
|
|
||||||
|
#interval(100)
|
||||||
if(first()) {
|
if(first()) {
|
||||||
Radio = entity()
|
Radio = entity()
|
||||||
URL = "https://www.dropbox.com/s/7l6v3nync6cq575/oki doki boomer.mp3?dl=0&raw=1"
|
URL = "https://www.dropbox.com/s/7l6v3nync6cq575/oki doki boomer.mp3?dl=0&raw=1"
|
||||||
}
|
}
|
||||||
|
|
||||||
if(streamCanStart()) {
|
if(streamCanStart()) {
|
||||||
Radio:streamStart(randint(0, 100), 100, URL)
|
Radio:streamStart(1, 100, URL)
|
||||||
}
|
}
|
||||||
459
xevion/projects/Printer Bank/printer_bank_manager_v1.txt
Normal file
459
xevion/projects/Printer Bank/printer_bank_manager_v1.txt
Normal file
@@ -0,0 +1,459 @@
|
|||||||
|
@name Printer Bank Manager V1 by Xevion
|
||||||
|
@inputs EGP:wirelink User:entity
|
||||||
|
@persist SelectIndex:number BITMINER_POWER:table Selected:array TAX:number Mode:string OWNER_NAME:string PRINTER_MAX:table PRINTER_UGPRADE:table PRINTER_COSTS:table PRINTER_TYPE:string COLOR_CHATBLUE:vector
|
||||||
|
@trigger
|
||||||
|
|
||||||
|
# Chat Commands
|
||||||
|
# &tax <float> - Moves the tax to a certain level. 1.00 = +100%. Can be negative.
|
||||||
|
# &clearinv - Forcefully clear selected items
|
||||||
|
# &cleargui - Move to main menu
|
||||||
|
# &clearall - clearinv & cleargui combined
|
||||||
|
# &time <time> - Set the current contract time (in hours).
|
||||||
|
# &sumcost - Print the raw cost of buying the selected items.
|
||||||
|
# &sumtax - Print the inflicted payment upon buying the select items.
|
||||||
|
# &sumcontract - The amount of money paid upon contract signature.
|
||||||
|
# &name <name> - Sets the name of the Shop to the specificed name. Useful in-case of long names.
|
||||||
|
|
||||||
|
# Begin program intervals, timers etc.
|
||||||
|
runOnChat(1)
|
||||||
|
|
||||||
|
# Constants and other first-only executions
|
||||||
|
if (first()) {
|
||||||
|
print("first")
|
||||||
|
EGP:egpClear() # Clear in-case E2 is repasted
|
||||||
|
PRINTER_COSTS = table() # holds the constant costs of printers
|
||||||
|
PRINTER_MAX = table() # holds constants concerning the maximum of each printer
|
||||||
|
PRINTER_UPGRADE = table()
|
||||||
|
BITMINER_POWER = table()
|
||||||
|
TAX = 0.5
|
||||||
|
OWNER_NAME = owner():name()
|
||||||
|
|
||||||
|
Mode = "main"
|
||||||
|
Selected = array()
|
||||||
|
|
||||||
|
# Often used Colors
|
||||||
|
COLOR_CHATBLUE = vec(162, 162, 241)
|
||||||
|
|
||||||
|
### Configure printer costs (bitminer only)
|
||||||
|
# SERVER 7 x CPU ($2,000) = $14,000
|
||||||
|
# S2 -
|
||||||
|
# S1 - 3 Cores ($50,000), 7 CPUs ($2,000)
|
||||||
|
|
||||||
|
## Configure printer price costs here in-case they change
|
||||||
|
# Bitminers
|
||||||
|
PRINTER_COSTS["bitminer_rack", number] = 100000
|
||||||
|
PRINTER_COSTS["bitminer_server", number] = 50000
|
||||||
|
PRINTER_COSTS["bitminer_s2", number] = 25000
|
||||||
|
PRINTER_COSTS["bitminer_s1", number] = 5000
|
||||||
|
PRINTER_COSTS["bitminer_extensionlead", number] = 500
|
||||||
|
PRINTER_COSTS["bitminer_powerlead", number] = 500
|
||||||
|
PRINTER_COSTS["bitminer_generator", number] = 6000
|
||||||
|
PRINTER_COSTS["bitminer_fueltankline", number] = 11500
|
||||||
|
|
||||||
|
# Moneyprinters
|
||||||
|
PRINTER_COSTS["printer_sapphire", number] = 20000
|
||||||
|
PRINTER_COSTS["printer_emerald", number] = 45000
|
||||||
|
PRINTER_COSTS["printer_ruby", number] = 60000
|
||||||
|
PRINTER_COSTS["printer_diamond", number] = 85000
|
||||||
|
PRINTER_COSTS["printer_platinum", number] = 150000
|
||||||
|
PRINTER_COSTS["printer_god", number] = 350000
|
||||||
|
|
||||||
|
## Configure printer maximums here in-case they change
|
||||||
|
# Bitminers
|
||||||
|
PRINTER_MAX["bitminer_rack", number] = 2
|
||||||
|
PRINTER_MAX["bitminer_server", number] = 16
|
||||||
|
PRINTER_MAX["bitminer_s2", number] = 4
|
||||||
|
PRINTER_MAX["bitminer_s1", number] = 4
|
||||||
|
PRINTER_MAX["bitminer_extensionlead", number] = 8
|
||||||
|
PRINTER_MAX["bitminer_powerlead", number] = 10
|
||||||
|
PRINTER_MAX["bitminer_generator", number] = 3
|
||||||
|
PRINTER_MAX["bitminer_fueltankline", number] = 2
|
||||||
|
|
||||||
|
# Moneyprinters
|
||||||
|
PRINTER_MAX["printer_sapphire", number] = 2
|
||||||
|
PRINTER_MAX["printer_emerald", number] = 2
|
||||||
|
PRINTER_MAX["printer_ruby", number] = 2
|
||||||
|
PRINTER_MAX["printer_diamond", number] = 2
|
||||||
|
PRINTER_MAX["printer_platinum", number] = 1
|
||||||
|
PRINTER_MAX["printer_god", number] = 1
|
||||||
|
|
||||||
|
## Bitminer Power Requirements
|
||||||
|
# Bitminer
|
||||||
|
BITMINER_POWER["bitminer_server", number] = 100
|
||||||
|
BITMINER_POWER["bitminer_s2", number] = 250
|
||||||
|
BITMINER_POWER["bitminer_s1", number] = 100
|
||||||
|
}
|
||||||
|
|
||||||
|
## Calculation
|
||||||
|
# addCommas - Returns a String from the Float or Integer Number provided WITH commas inserted.
|
||||||
|
function string addCommas(Value:number) {
|
||||||
|
local Split = Value:toString():explode(".")
|
||||||
|
local String = Split[1, string]
|
||||||
|
local InsertPos = String:length() - 3
|
||||||
|
while(InsertPos > 0) {
|
||||||
|
String = String:left(InsertPos) + "," + String:right(String:length() - InsertPos)
|
||||||
|
InsertPos -= 3
|
||||||
|
}
|
||||||
|
if(Split[2, string]) {
|
||||||
|
return String + "." + Split[2, string]
|
||||||
|
} else {
|
||||||
|
return String
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Counts the number of matching values in the array (only works with String values)
|
||||||
|
function number countValues(Array:array, Value:string) {
|
||||||
|
if(Array:count() > 0) {
|
||||||
|
local Count = 0
|
||||||
|
for(I = 1, Array:count(), 1) {
|
||||||
|
if(Array[I, string] == Value) {
|
||||||
|
Count++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Count
|
||||||
|
} else {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function ensureMinimum(Item:string, N:number) {
|
||||||
|
local Count = countValues(Selected, Item)
|
||||||
|
if(Count < N) {
|
||||||
|
local Difference = N - Count
|
||||||
|
for(I = 1, Difference, 1) {
|
||||||
|
# add(Item)
|
||||||
|
Selected:pushString(Item)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Complex function for calculating the number of generators requirement based on
|
||||||
|
# Ports left per Generator (Allocation number)
|
||||||
|
# PowerLeft
|
||||||
|
function number generatorsRequirement() {
|
||||||
|
local PowerLeft = array()
|
||||||
|
local Allocation = array()
|
||||||
|
|
||||||
|
for(I = 0, PRINTER_MAX["bitminer_rack", number], 1) {PowerLeft:pushNumber(1000),Allocation:pushNumber(0)}
|
||||||
|
|
||||||
|
print("-":repeat(15))
|
||||||
|
foreach(I, Item:string=Selected) {
|
||||||
|
if(BITMINER_POWER[Item, number] == 0) {continue}
|
||||||
|
print("Placing " + Item)
|
||||||
|
for(J = 1, PRINTER_MAX["bitminer_rack", number], 1) {
|
||||||
|
print("Trying to place in Generator " + J)
|
||||||
|
if(PowerLeft[J, number] >= BITMINER_POWER[Item, number] && Allocation[J, number] < 8) {
|
||||||
|
print("Placed in Generator " + J)
|
||||||
|
PowerLeft[J, number] = PowerLeft[J, number] - BITMINER_POWER[Item, number]
|
||||||
|
Allocation[J, number] = Allocation[J, number] + 1
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
local GeneratorCount = 0
|
||||||
|
for(X = 1, Allocation:count(), 1) {
|
||||||
|
if(Allocation[X, number] > 0) {
|
||||||
|
GeneratorCount += 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
printTable(PowerLeft)
|
||||||
|
return GeneratorCount
|
||||||
|
}
|
||||||
|
|
||||||
|
function ensureRequirements(Item:string) {
|
||||||
|
local Count = generatorsRequirement()
|
||||||
|
ensureMinimum("bitminer_rack", Count)
|
||||||
|
ensureMinimum("bitminer_generator", Count)
|
||||||
|
ensureMinimum("bitminer_fueltankline", Count)
|
||||||
|
ensureMinimum("bitminer_powerlead", Count)
|
||||||
|
#[
|
||||||
|
if(Item == "bitminer_server") {
|
||||||
|
local ServerCount = countValues(Selected, Item)
|
||||||
|
# Generators, Racks, Powerleads, and FuelTanks + Fuel Lines
|
||||||
|
local Needed = ceil(ServerCount / 8)
|
||||||
|
ensureMinimum("bitminer_rack", Needed)
|
||||||
|
ensureMinimum("bitminer_generator", Needed)
|
||||||
|
ensureMinimum("bitminer_fueltankline", Needed)
|
||||||
|
ensureMinimum("bitminer_powerlead", Needed)
|
||||||
|
} elseif(Item == "bitminer_s2") {
|
||||||
|
local S2Count = countValues(Selected, Item)
|
||||||
|
local Needed = ceil(S2Count / 4)
|
||||||
|
ensureMinimum("bitminer_generator", Needed)
|
||||||
|
ensureMinimum("bitminer_fueltankline", Needed)
|
||||||
|
ensureMinimum("bitminer_extensionlead", Needed)
|
||||||
|
ensureMinimum("bitminer_powerlead", S2Count)
|
||||||
|
}
|
||||||
|
]#
|
||||||
|
}
|
||||||
|
|
||||||
|
# Logic for adding items (bitminers/printers) to the inventory queue
|
||||||
|
function void add(Item:string) {
|
||||||
|
if(countValues(Selected, Item) < PRINTER_MAX[Item, number]) {
|
||||||
|
Selected:pushString(Item)
|
||||||
|
ensureRequirements(Item)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# onClick - decides if the user has clicked a specific box
|
||||||
|
function number onClick(ID){
|
||||||
|
local Position = EGP:egpPos(ID)
|
||||||
|
local Height = EGP:egpSize(ID)/2
|
||||||
|
local Cursor = EGP:egpCursor(User)
|
||||||
|
if(Position:x() == -1 || Position:y() == -1 || Height:x() == -1 || Height:y() == -1 || Cursor:x() == -1 || Cursor:y() == -1) {
|
||||||
|
return 0
|
||||||
|
} else {
|
||||||
|
# print(Position, Height, EGP:egpCursor(User))
|
||||||
|
return inrange(Cursor,Position-Height,Position+Height)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
# sumCost - sums costs of Items provided
|
||||||
|
function number sumCost(Items:array) {
|
||||||
|
local Cost = 0
|
||||||
|
if(Items:count() > 0) {
|
||||||
|
for(I = 0, Items:count(), 1) {
|
||||||
|
Cost += PRINTER_COSTS[Items[I, string], number]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Cost
|
||||||
|
}
|
||||||
|
|
||||||
|
# sumTax - finds taxed cuts of Item costs
|
||||||
|
function number sumTax(Items:array) {return sumCost(Items) * TAX}
|
||||||
|
# sumContract
|
||||||
|
function number sumContract(Items:array) {return sumCost(Items) * (1 + TAX)}
|
||||||
|
# Function Overloads
|
||||||
|
function number sumCost() {return sumCost(Selected)}
|
||||||
|
function number sumTax() {return sumTax(Selected)}
|
||||||
|
function number sumContract() {return sumContract(Selected)}
|
||||||
|
|
||||||
|
## Graphics Drawing
|
||||||
|
function top_title(ID1:number, ID2:number, ID3:number, Text:string) {
|
||||||
|
EGP:egpRoundedBox(11,vec2(254,20),vec2(440,40))
|
||||||
|
EGP:egpColor(11,vec(1,110,140))
|
||||||
|
EGP:egpRoundedBox(12,vec2(254,20),vec2(434,34))
|
||||||
|
EGP:egpColor(12,vec(1,200,255))
|
||||||
|
EGP:egpText(13, Text,vec2(256,20))
|
||||||
|
EGP:egpFont(13,"coolvetica",35)
|
||||||
|
EGP:egpAlign(13,1,1)
|
||||||
|
EGP:egpColor(13,vec(0,0,0))
|
||||||
|
}
|
||||||
|
|
||||||
|
# Creates a basic box at position
|
||||||
|
function list_box(Index:number, BoxID:number, TextID:number, Text:string) {
|
||||||
|
local Position = vec2(256, 75 + (50 * (Index - 1)))
|
||||||
|
EGP:egpBox(BoxID, Position, vec2(380,40))
|
||||||
|
EGP:egpColor(BoxID,vec(1,200,255))
|
||||||
|
EGP:egpAlign(BoxID,1,1)
|
||||||
|
# Text
|
||||||
|
EGP:egpText(TextID, Text, Position)
|
||||||
|
EGP:egpFont(TextID,"coolvetica",23)
|
||||||
|
EGP:egpColor(TextID,vec(0,0,0))
|
||||||
|
EGP:egpAlign(TextID,1,1)
|
||||||
|
}
|
||||||
|
|
||||||
|
function list_price_box(Index:number, BoxID:number, TextID:number, PriceID:number, CountID:number, Text:string, ItemID:string) {
|
||||||
|
local BoxPosition = vec2(256, 75 + (50 * (Index - 1)))
|
||||||
|
local TextPosition = BoxPosition + vec2(-192 + 16, 0)
|
||||||
|
EGP:egpBox(BoxID, BoxPosition, vec2(380,40))
|
||||||
|
EGP:egpColor(BoxID,vec(1,200,255))
|
||||||
|
EGP:egpAlign(BoxID,1,1)
|
||||||
|
# Item Name Text
|
||||||
|
EGP:egpText(TextID, Text, TextPosition)
|
||||||
|
EGP:egpFont(TextID,"coolvetica",23)
|
||||||
|
EGP:egpColor(TextID,vec(0,0,0))
|
||||||
|
EGP:egpAlign(TextID,0,1)
|
||||||
|
# Item Price Text
|
||||||
|
EGP:egpText(PriceID, "+$" + addCommas(PRINTER_COSTS[ItemID, number] * TAX), TextPosition + vec2(180, 0))
|
||||||
|
EGP:egpFont(PriceID,"coolvetica",25)
|
||||||
|
EGP:egpColor(PriceID, vec(0,0,0))
|
||||||
|
#EGP:egpColor(PriceID,vec(24,215,24))
|
||||||
|
EGP:egpAlign(PriceID,0,1)
|
||||||
|
# Item Count Text
|
||||||
|
EGP:egpText(CountID, countValues(Selected, ItemID) + " / " + PRINTER_MAX[ItemID, number], TextPosition + vec2(345, 0))
|
||||||
|
EGP:egpFont(CountID,"coolvetica",23)
|
||||||
|
EGP:egpColor(CountID,vec(0,0,0))
|
||||||
|
EGP:egpAlign(CountID,2,1)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function subtitle_text(ID:number, Text:string) {
|
||||||
|
EGP:egpText(ID, Text, vec2(256,450))
|
||||||
|
EGP:egpFont(ID,"coolvetica",23)
|
||||||
|
EGP:egpColor(21,vec(0,0,0))
|
||||||
|
EGP:egpAlign(21,1,1)
|
||||||
|
}
|
||||||
|
|
||||||
|
function bottom_box(ID:number, Text:string) {
|
||||||
|
# Top Element
|
||||||
|
EGP:egpRoundedBox(14,vec2(254,490),vec2(440,40))
|
||||||
|
EGP:egpColor(14,vec(1,110,140))
|
||||||
|
# Shadow Element
|
||||||
|
EGP:egpRoundedBox(15,vec2(254,490),vec2(434,34))
|
||||||
|
EGP:egpColor(15,vec(1,200,255))
|
||||||
|
# Text
|
||||||
|
EGP:egpText(ID,Text,vec2(255,490))
|
||||||
|
EGP:egpFont(ID,"coolvetica",23)
|
||||||
|
EGP:egpAlign(ID,1,1)
|
||||||
|
EGP:egpColor(ID,vec(0,0,0))
|
||||||
|
}
|
||||||
|
|
||||||
|
# Main Menu Graphical Logic
|
||||||
|
function void base_menu() {
|
||||||
|
EGP:egpClear()
|
||||||
|
### Center Gradients
|
||||||
|
## Top Portion Gradient
|
||||||
|
EGP:egpBox(1,vec2(256,256),vec2(520,520))
|
||||||
|
EGP:egpMaterial(1,"gui/gradient_up")
|
||||||
|
EGP:egpColor(1,vec(42,200,240))
|
||||||
|
## Bottom Portion Gradient
|
||||||
|
EGP:egpBox(2,vec2(256,256),vec2(520,520))
|
||||||
|
EGP:egpMaterial(2,"gui/gradient_down")
|
||||||
|
EGP:egpColor(2,vec(1,70,90))
|
||||||
|
### Right/Left Lighter Boxes
|
||||||
|
## Left
|
||||||
|
EGP:egpBox(3,vec2(15,256),vec2(35,550))
|
||||||
|
EGP:egpColor(3,vec(1,110,140))
|
||||||
|
## Right
|
||||||
|
EGP:egpBox(4,vec2(495,256),vec2(35,550))
|
||||||
|
EGP:egpColor(4,vec(1,110,140))
|
||||||
|
### Top/Bottom Underlying Dark Cyan
|
||||||
|
## Bottom
|
||||||
|
EGP:egpBox(5,vec2(256,495),vec2(450,35))
|
||||||
|
EGP:egpColor(5,vec(1,110,140))
|
||||||
|
## Top
|
||||||
|
EGP:egpBox(6,vec2(256,15),vec2(450,35))
|
||||||
|
EGP:egpColor(6,vec(1,110,140))
|
||||||
|
### Top & Bottom Ultralight Trim Corners
|
||||||
|
## Top
|
||||||
|
EGP:egpBox(7,vec2(256,18),vec2(485,5))
|
||||||
|
EGP:egpColor(7,vec(1,200,255))
|
||||||
|
## Bottom
|
||||||
|
EGP:egpBox(8,vec2(256,493),vec2(485,5))
|
||||||
|
EGP:egpColor(8,vec(1,200,255))
|
||||||
|
### Left and Right Vertical Trim
|
||||||
|
## Right
|
||||||
|
EGP:egpBox(9,vec2(496,256),vec2(5,478))
|
||||||
|
EGP:egpColor(9,vec(1,200,255))
|
||||||
|
## Left
|
||||||
|
EGP:egpBox(10,vec2(16,256),vec2(5,478))
|
||||||
|
EGP:egpColor(10,vec(1,200,255))
|
||||||
|
top_title(11, 12, 13, OWNER_NAME + "'s Printer Bank")
|
||||||
|
}
|
||||||
|
|
||||||
|
function void backbutton() {
|
||||||
|
# Visible Triangle
|
||||||
|
EGP:egpTriangle(100, vec2(42, 19), vec2(67, 9), vec2(67, 27))
|
||||||
|
EGP:egpColor(100, vec(0,65,86))
|
||||||
|
# Visible Rectangle
|
||||||
|
EGP:egpBox(101, vec2(80, 19), vec2(30, 7))
|
||||||
|
EGP:egpColor(101, vec(0,65,86))
|
||||||
|
# Invisible Button Rectangle
|
||||||
|
EGP:egpBoxOutline(102, vec2(69, 19), vec2(53, 19))
|
||||||
|
EGP:egpColor(102, vec4(0,0,0,0)) # change alpha to see
|
||||||
|
}
|
||||||
|
|
||||||
|
function void main_menu(){
|
||||||
|
local CurCost = sumContract()
|
||||||
|
if(CurCost <= 0) {
|
||||||
|
bottom_box(16, "Select a Type of Printer or Bitminer to Sell")
|
||||||
|
} else {
|
||||||
|
bottom_box(16, "We'll pay $" + addCommas(CurCost) + " for these items")
|
||||||
|
}
|
||||||
|
list_box(1, 17, 18, "Bitminers")
|
||||||
|
list_box(2, 19, 20, "Printers")
|
||||||
|
subtitle_text(21, "If You Experience Any Issues PM " + OWNER_NAME)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
# Bitminers Menu Graphical Logic
|
||||||
|
function void bitminers_menu() {
|
||||||
|
base_menu()
|
||||||
|
backbutton()
|
||||||
|
list_price_box(1, 200, 201, 202, 203, "Bitminer Rack", "bitminer_rack")
|
||||||
|
list_price_box(2, 204, 205, 206, 207, "Bitminer Server", "bitminer_server")
|
||||||
|
list_price_box(3, 208, 209, 210, 211, "Bitminer S2", "bitminer_s2")
|
||||||
|
list_price_box(4, 212, 213, 214, 215, "Bitminer S1", "bitminer_s1")
|
||||||
|
list_price_box(5, 216, 217, 218, 219, "Generator", "bitminer_generator")
|
||||||
|
list_price_box(6, 220, 221, 222, 223, "Fuel Tank & Line", "bitminer_fueltankline")
|
||||||
|
list_price_box(7, 224, 225, 226, 227, "Power Lead", "bitminer_powerlead")
|
||||||
|
list_price_box(8, 228, 229, 230, 231, "Extension Lead", "bitminer_extensionlead")
|
||||||
|
}
|
||||||
|
|
||||||
|
# Printers Menu Graphical Logic
|
||||||
|
function void printers_menu() {
|
||||||
|
base_menu()
|
||||||
|
backbutton()
|
||||||
|
list_price_box(1, 200, 201, 202, 203, "Sapphire Printer", "printer_sapphire")
|
||||||
|
list_price_box(2, 204, 205, 206, 207, "Emerald Printer", "printer_emerald")
|
||||||
|
list_price_box(3, 208, 209, 210, 211, "Ruby Printer", "printer_ruby")
|
||||||
|
list_price_box(4, 212, 213, 214, 215, "Diamond Printer", "printer_diamond")
|
||||||
|
list_price_box(5, 216, 217, 218, 219, "Platinum Printer", "printer_platinum")
|
||||||
|
list_price_box(6, 220, 221, 222, 223, "GOD Printer", "printer_god")
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!chatClk()) {
|
||||||
|
hint("Reloaded Screen on " + Mode, 0.4)
|
||||||
|
if(Mode == "main") {
|
||||||
|
if(onClick(17)) {
|
||||||
|
Mode = "bitminers"
|
||||||
|
} elseif(onClick(19)) {
|
||||||
|
Mode = "printers"
|
||||||
|
} else {
|
||||||
|
base_menu()
|
||||||
|
main_menu()
|
||||||
|
}
|
||||||
|
} elseif(Mode == "bitminers") {
|
||||||
|
if(onClick(102)){Mode = "main"}
|
||||||
|
elseif(onClick(200)) {add("bitminer_rack")}
|
||||||
|
elseif(onClick(204)) {add("bitminer_server")}
|
||||||
|
elseif(onClick(208)) {add("bitminer_s2")}
|
||||||
|
elseif(onClick(212)) {add("bitminer_s1")}
|
||||||
|
elseif(onClick(216)) {add("bitminer_generator")}
|
||||||
|
elseif(onClick(220)) {add("bitminer_fueltankline")}
|
||||||
|
elseif(onClick(224)) {add("bitminer_powerlead")}
|
||||||
|
elseif(onClick(228)) {add("bitminer_extensionlead")}
|
||||||
|
else {
|
||||||
|
base_menu()
|
||||||
|
bitminers_menu()
|
||||||
|
}
|
||||||
|
} elseif(Mode == "printers") {
|
||||||
|
if(onClick(102)) {Mode = "main"}
|
||||||
|
elseif(onClick(200)) {add("printer_sapphire")}
|
||||||
|
elseif(onClick(204)) {add("printer_emerald")}
|
||||||
|
elseif(onClick(208)) {add("printer_ruby")}
|
||||||
|
elseif(onClick(212)) {add("printer_diamond")}
|
||||||
|
elseif(onClick(216)) {add("printer_platinum")}
|
||||||
|
elseif(onClick(220)) {add("printer_god")}
|
||||||
|
else {
|
||||||
|
base_menu()
|
||||||
|
printers_menu()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} elseif(chatClk(owner())) {
|
||||||
|
LastSaid = lastSaid():explode(" ")
|
||||||
|
HideChat = 1
|
||||||
|
if(LastSaid[1, string] == "!tax") {TAX = LastSaid[2, string]:toNumber(),timer("reload", 20)}
|
||||||
|
elseif(LastSaid[1, string] == "!clearinv") {Selected = array(),printColor(COLOR_CHATBLUE,"Reset Selected Items")}
|
||||||
|
elseif(LastSaid[1, string] == "!cleargui") {Mode = "main",printColor(COLOR_CHATBLUE, "Reset GUI")}
|
||||||
|
elseif(LastSaid[1, string] == "!clearall") {Mode = "main",Selected = array(),printColor(COLOR_CHATBLUE, "Reset all Menus")}
|
||||||
|
elseif(LastSaid[1, string] == "!time") {Time = LastSaid[2, string]:toNumber(),printColor(COLOR_CHATBLUE, "Set Contract Time to " + LastSaid[2, string] + " Hours")}
|
||||||
|
elseif(LastSaid[1, string] == "!sumcost") {printColor(COLOR_CHATBLUE, "Not yet implemented")}
|
||||||
|
elseif(LastSaid[1, string] == "!sumtax") {print("Not yet implemented")}
|
||||||
|
elseif(LastSaid[1, string] == "!sumcontract") {print("Not yet implemented")}
|
||||||
|
elseif(LastSaid[1, string] == "!name") {OWNER_NAME = LastSaid[2, string], hint("Name changed to \"" + OWNER_NAME + "\"", 1.0),timer("execute", 20)}
|
||||||
|
else {HideChat = 0}
|
||||||
|
if(HideChat == 1){hideChat(1)}
|
||||||
|
|
||||||
|
#[
|
||||||
|
&tax <float> - Moves the tax to a certain level. 1.00 = +100%. Can be negative.
|
||||||
|
&clearinv - Forcefully clear selected items
|
||||||
|
&cleargui - Move to main menu
|
||||||
|
&clearall - clearinv & cleargui combined
|
||||||
|
&time <time> - Set the current contract time (in hours).
|
||||||
|
&sumcost - Print the raw cost of buying the selected items.
|
||||||
|
&sumtax - Print the inflicted payment upon buying the select items.
|
||||||
|
&sumcontract - The amount of money paid upon contract signature.
|
||||||
|
&name <name> - Sets the name of the Shop to the specificed name. Useful in-case of long names.
|
||||||
|
]#
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user