Skip to content

Instantly share code, notes, and snippets.

@fixator10
Last active February 4, 2021 12:54
Show Gist options
  • Save fixator10/e6dc5a750f889fee10d5e2ebfa241a4d to your computer and use it in GitHub Desktop.
Save fixator10/e6dc5a750f889fee10d5e2ebfa241a4d to your computer and use it in GitHub Desktop.
@name "Radio Disco Lamp" by Romanaldo
@persist Z Timer On Tick [E O]:entity
@model models/holograms/hq_sphere.mdl
if(first()|duped()){
E=entity()
O=owner()
#################
#CONFIG
#################
V=1 #Volume (0-1?)
Station="http://127.0.0.1:8080" #Custom station, if you don't know how to add your.
#################
#################
#Stations List
#################
######Record#####
#Record 128 Rock | /rock
#Record 128 Breaks | /brks
#Record 128 Club | /club
#Record 128 Chillout | /chil
#Record 128 Dancecore | /dc
#Record 128 Deep | /deep
#Record 128 Dubstep | /dub
#Record 128 GOP FM | /gop
#Record 128 Medlyak FM | /mdl
#Record 128 Pirate | /ps
#Record 128 Pump'n'Klubb | /pump
######Custom##### [RUS]
#AnimeRadio.su [RUS|JP] | /anime
##Retro.FM
#32k [LOW] | /retro32
#64k [LOW-MEDIUM] | /retro64
#128k[MEDIUM] | /retro128
#256k[HI-FI (HIGH)] | /retro256
#70 Years 128k | /retro70
#80 Years 128k | /retro80
#90 Years 128k | /retro90
#Dorognoe | /road
######Custom##### [NonRUS]
#NightCoreRadio.com | /nightcore
#Touhou [JP] | /touhou
#Listen.Moe [JP] | /moe
#################
#Custom station (CFG) | /custom
#Disable Radio | /stop
E:propFreeze(0)
holoCreate(1,E:toWorld(vec(0,0,-5)),vec(1,0.8,1),E:angles(),vec(50),"models/Items/combine_rifle_ammo01.mdl")
holoParent(1,E)
holoMaterial(1,"phoenix_storms/gear")
holoCreate(2,E:toWorld(vec(0,0,2.5)),vec(1.2,1.2,0.2),E:angles(),vec(70),"hq_dome")
holoParent(2,E)
holoMaterial(2,"phoenix_storms/dome")
holoCreate(3,E:toWorld(vec(0,0,-3.5)),vec(0.9,0.9,0.25),E:toWorld(ang(0,0,180)),vec(70),"hq_dome")
holoParent(3,E)
holoMaterial(3,"phoenix_storms/dome")
holoCreate(4,E:toWorld(vec(0,0,3.1)),vec(0.5),E:angles(),vec(70),"hq_dome")
holoParent(4,E)
holoMaterial(4,"phoenix_storms/dome")
holoCreate(5,E:toWorld(vec(0,0,5.7)),vec(0.2),E:toWorld(ang(0,0,90)),vec(70),"hq_torus")
holoParent(5,E)
holoMaterial(5,"phoenix_storms/dome")
holoCreate(6,E:toWorld(vec(0,0,0)),vec(0.3,0.3,0.5),E:angles(),vec(255),"hq_cylinder")
holoParent(6,E)
holoMaterial(6,"lights/white")
E:setdLight(E:pos(),vec(255),3,500,0)
E:noCollideAll(1)
E:setAlpha(0)
On=1
runOnChat(1)
}
runOnKeys(O,1)
if(O:keyPressed("L")){
E:dLightColor(vec(255))
holoColor(6,vec(255))
On=1
}elseif(O:keyPressed("O")){
E:dLightColor(vec(0))
holoColor(6,vec(0))
On=0
}
timer("tick",100)
if(clk("tick")){
if(On){
particleGravity(vec(0))
particle(2,5,0,"sprites/glow04_noz",hsv2rgb(Tick,1,1),E:pos(),randvec(-10,10))
particle(2,5,0,"sprites/glow04_noz",hsv2rgb(Tick,1,1),E:pos(),randvec(-10,10))
}
Tick++
if(Tick>360){Tick=0}
holoColor(6,hsv2rgb(Tick,1,1))
E:dLightColor(hsv2rgb(Tick,1,1))
}
timer("pos",1)
if(clk("pos")){
Timer+=0.1
Z = sinr(Timer)/5
E:setPos(E:pos()+vec(0,0,Z))
E:setAng(ang(0))
if(E:pos():distance(O:toWorld(vec(-20,20,80)))>1){
E:applyForce((O:toWorld(vec(-20,20,90)))-E:pos())
}else{
E:applyForce(vec(0,0,E:mass()*9))
}
}
if(chatClk(O)){
switch(O:lastSaid()){
#Radio Record
#http://online.radiorecord.ru:8102/
case"/rock",
hideChat(1)
soundURLpause(1)
soundURLload(1,"http://air.radiorecord.ru:8102/rock_128",V,0,E)
printColor(vec(255,255,0),"Now playing",vec(255),": Record | Rock")
break
case"/brks",
hideChat(1)
soundURLpause(1)
soundURLload(1,"http://air.radiorecord.ru:8102/brks_128",V,0,E)
printColor(vec(255,255,0),"Now playing",vec(255),": Record | Breaks")
break
case"/club",
hideChat(1)
soundURLpause(1)
soundURLload(1,"http://air.radiorecord.ru:8102/club_128",V,0,E)
printColor(vec(255,255,0),"Now playing",vec(255),": Record | Club")
break
case"/chil",
hideChat(1)
soundURLpause(1)
soundURLload(1,"http://air.radiorecord.ru:8102/chil_128",V,0,E)
printColor(vec(255,255,0),"Now playing",vec(255),": Record | Chillout")
break
case"/dc",
hideChat(1)
soundURLpause(1)
soundURLload(1,"http://air.radiorecord.ru:8102/dc_128",V,0,E)
printColor(vec(255,255,0),"Now playing",vec(255),": Record | Dancecore")
break
case"/deep",
hideChat(1)
soundURLpause(1)
soundURLload(1,"http://air.radiorecord.ru:8102/deep_128",V,0,E)
printColor(vec(255,255,0),"Now playing",vec(255),": Record | Deep")
break
case"/dub",
hideChat(1)
soundURLpause(1)
soundURLload(1,"http://air.radiorecord.ru:8102/dub_128",V,0,E)
printColor(vec(255,255,0),"Now playing",vec(255),": Record | Dubstep")
break
case"/gop",
hideChat(1)
soundURLpause(1)
soundURLload(1,"http://air.radiorecord.ru:8102/gop_128",V,0,E)
printColor(vec(255,255,0),"Now playing",vec(255),": Record | GOP FM")
break
case"/mdl",
hideChat(1)
soundURLpause(1)
soundURLload(1,"http://air.radiorecord.ru:8102/mdl_128",V,0,E)
printColor(vec(255,255,0),"Now playing",vec(255),": Record | Medlyak FM")
break
case"/ps",
hideChat(1)
soundURLpause(1)
soundURLload(1,"http://air.radiorecord.ru:8102/ps_128",V,0,E)
printColor(vec(255,255,0),"Now playing",vec(255),": Record | Pirate Station")
break
case"/pump",
hideChat(1)
soundURLpause(1)
soundURLload(1,"http://air.radiorecord.ru:8102/pump_128",V,0,E)
printColor(vec(255,255,0),"Now playing",vec(255),": Record | Pump'n'Klubb")
break
#########CUSTOM#ADDED#STATIONS#########
case"/anime", #AnimeRadio.su (Ghost Anime Radio)
hideChat(1)
soundURLpause(1)
soundURLload(1,"http://animeradio.su:8000",V,0,E)
printColor(vec(255,255,0),"Now playing",vec(255),": AnimeRadio.su")
break
#RetroFM (retrofm.ru)
#case"/retro128", #RetroFM St. Petersburg 128k #Dead - TimeOut
#hideChat(1)
#soundURLpause(1)
#soundURLload(1,"http://onair.eltel.net/retrofm-128k",V,0,E)
#printColor(vec(255,255,0),"Now playing",vec(255),": Record 128 Rock")
#break
#case"/retro64", #RetroFM St. Petersburg 64k #Dead - TimeOut
#hideChat(1)
#soundURLpause(1)
#soundURLload(1,"http://onair.eltel.net/retrofm-64k",V,0,E)
#printColor(vec(255,255,0),"Now playing",vec(255),": Record 128 Rock")
#break
case"/retro32", #RetroFM MSK 32k [LOW]
hideChat(1)
soundURLpause(1)
soundURLload(1,"http://retroserver.streamr.ru:8043/retro32",V,0,E) #http://retro32.streamr.ru
printColor(vec(255,255,0),"Now playing",vec(255),": Retro FM ", vec(255,50,15), "32k")
break
case"/retro64", #RetroFM MSK 64k [LOW-MEDIUM]
hideChat(1)
soundURLpause(1)
soundURLload(1,"http://retroserver.streamr.ru:8043/retro64",V,0,E) #http://retro64.streamr.ru
printColor(vec(255,255,0),"Now playing",vec(255),": Retro FM ", vec(255,150,15), "64k")
break
case"/retro128", #RetroFM MSK 128k [MEDIUM]
hideChat(1)
soundURLpause(1)
soundURLload(1,"http://retroserver.streamr.ru:8043/retro128",V,0,E) #http://retro128.streamr.ru
printColor(vec(255,255,0),"Now playing",vec(255),": Retro FM ", vec(255,255,50), "128k")
break
case"/retro256", #RetroFM MSK 256k [HI-FI (HIGH)]
hideChat(1)
soundURLpause(1)
soundURLload(1,"http://retroserver.streamr.ru:8043/retro256.mp3",V,0,E) #http://retro256.streamr.ru
printColor(vec(255,255,0),"Now playing",vec(255),": Retro FM ", vec(50,255,50), "HI-FI")
break
case"/retro70", #RetroFM 70Y 128k
hideChat(1)
soundURLpause(1)
soundURLload(1,"http://retro70.hostingradio.ru:8025/retro70-128.mp3",V,0,E) #http://retro70128.streamr.ru
printColor(vec(255,255,0),"Now playing",vec(255),": Retro FM 70 years")
break
case"/retro80", #RetroFM 80Y 128k
hideChat(1)
soundURLpause(1)
soundURLload(1,"http://retro80.hostingradio.ru:8025/retro80-128.mp3",V,0,E) #http://retro80128.streamr.ru
printColor(vec(255,255,0),"Now playing",vec(255),": Retro FM 80 years")
break
case"/retro90", #RetroFM 90Y 128k
hideChat(1)
soundURLpause(1)
soundURLload(1,"http://retro90.hostingradio.ru:8025/retro90-128.mp3",V,0,E) #http://retro90128.streamr.ru
printColor(vec(255,255,0),"Now playing",vec(255),": Retro FM 90 years")
break
#RetroFM end
case"/road", #Dorognoe Radio
hideChat(1)
soundURLpause(1)
soundURLload(1,"http://dorognoe.hostingradio.ru:8000/dorognoe_acc",V,0,E)
printColor(vec(255,255,0),"Now playing",vec(255),": Dorognoe Radio")
break
case"/nightcore", #NightcoreRadio #23.05.2016 | [HTTP/1.0 200 OK]
hideChat(1)
soundURLpause(1)
soundURLload(1,"http://stream.nightcoreradio.com:9040/main_stream",V,0,E)
printColor(vec(255,255,0),"Now playing",vec(255),": NightcoreRadio")
break
case"/touhou", #TouhouRadio
hideChat(1)
soundURLpause(1)
soundURLload(1,"http://touhouradio.com:8000/touhouradio.mp3",V,0,E)
printColor(vec(255,255,0),"Now playing",vec(255),": Touhou Radio")
break
case"/moe", #Listen.moe
hideChat(1)
soundURLpause(1)
soundURLload(1, "https://listen.moe/vorbis",V,0,E)
printColor(vec(255,255,0) "Now playing",vec(255),": Listen.moe")
break
case"/custom",
hideChat(1)
soundURLpause(1)
soundURLload(1,Station,V,0,E)
printColor(vec(255,255,0),"Now playing",vec(255),": Custom Configurated Station")
break
case"/stop",
hideChat(1)
soundURLpause(1)
printColor(vec(255,50,50),"Radio Disabled")
break
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment