Welcome Guest, Not a member yet? Login with Steam   Create Account  




print("Hello world!")

#11

This is akin to cheating but...

Code:
++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.

From here: https://en.wikipedia.org/wiki/Brainfuck#Hello_World.21

Offtopic, but to prove that I can write in the language (despite never having done so before), I did write my own piece of Brainfuck code for good measure. It sucks, but enjoy decoding this shit without an interpreter :P. (I really should be using more loops within loops, but I really can't keep track of all of the loop counters in Brainfuck, hence why I kept creating new ones.)

Code:
++++++++[>+++++++++++>++++++++++++>+++++++++++++>++++++++++++++<<<<-]>-.>+++++.>++++.<--.>>-.--.<<++.>>>++++[>++++++++<-]>.>++++++++++[>+++++++++++<-]>++++++.-----.<<.>>>+++++++++++[>+++++++++>++++++++++>+++++++++>+++++++++++>+++<<<<<-]>-.>++++.<-.>>++++++.<----.>---.>----.<<<++.>>+++++.>>.>++++++++++.

Reply

#12

#include <iostream>

int main()
{
std::cout << "Hello World!";
}

all i can be bothered to learn in C++
fuck off
Reply

#13

local ShouldSetOwner = false -- Set the entity's owner?

-------------------------------
AddCSLuaFile( "cl_init.lua" )
AddCSLuaFile( "shared.lua" )
include( 'shared.lua' )
-------------------------------
-- Add the names of all jobs that should be allowed to capture the command post. Add to ENT.TEAM1 for CIS, ENT.TEAM2 for Republic

ENT.initval = 0
ENT.captval = 5
ENT.captureradius = 100


function ENT:updateValue()
self.TEAM_1_NAME = file.Read("cpteam1.txt")
self.TEAM_2_NAME = file.Read("cpteam2.txt")
self.TEAM_1 = util.JSONToTable(file.Read("cpjoblist1.txt"))
self.TEAM_2 = util.JSONToTable(file.Read("cpjoblist2.txt"))
if self.teamcontrolled == "TEAM_1" then
self.TCString = file.Read("cpteam1.txt")
elseif self.teamcontrolled == "TEAM_2" then
self.TCString = file.Read("cpteam2.txt")
else
self.TCString = "None"
end
if self.CanTeleportTo == true then
self.CCTString = "Yes"
else
self.CCTString = "No"
end
self:SetCPName( self.cpname);
self:SetTeamControlled( self.TCString );
self:SetCanTele( self.CCTString );
self:SetJobList1( file.Read("cpjoblist1.txt") )
self:SetJobList2( file.Read("cpjoblist2.txt") )
self:SetJobName1( file.Read("cpteam1.txt") )
self:SetJobName2( file.Read("cpteam2.txt") )
self:SetInitval( self.initval );
self:SetCaptval( self.captval );
self:SetRadiuss( self.captureradius );

end
--------------------
-- Spawn Function --
--------------------
function ENT:SpawnFunction( ply, tr )
end

----------------
-- Initialize --
----------------
function ENT:Initialize()
util.AddNetworkString( "dopanel" );
util.AddNetworkString( "cappanel" );
util.AddNetworkString( "Teleport" );
end

function ENT:Think()
self:updateValue()
if ( self.Delay > CurTime() ) then return end
self:Pingas()
self.Delay = CurTime() + 1
end

function ENT:Pingas()
local cps = ents.FindByClass("ent_commandpost")
for key, var in pairs (cps) do
var:Capture()
if self.capturetype == "Jobs" then
var:Detect()
end
if self.capturetype == "ULX Groups" then
var:DetectULX()
end
end
end

function ENT:Detect()
local targets = ents.FindInSphere(self:GetPos(), self.captureradius)
for k, trg in pairs(targets) do
if IsValid(trg) then
local ply2 = player.GetHumans()
for k, play in pairs(ply2) do
if IsValid(play) then
if table.HasValue(targets , play) then
local playerjob = play:getDarkRPVar("job")
net.Start("cappanel")
net.Send(play)
if table.HasValue(self.TEAM_1 , playerjob) == true then
self.TEAM1NearCP = true
else
self.TEAM1NearCP = false
end
if table.HasValue(self.TEAM_2 , playerjob) == true then
self.TEAM2NearCP = true
else
self.TEAM2NearCP = false
end
else
self.TEAM1NearCP = false
self.TEAM2NearCP = false
if ( self.Delay > CurTime() ) then return end
end
end
end
end
end
end

function ENT:DetectULX()
local targets = ents.FindInSphere(self:GetPos(), self.captureradius)
for k, trg in pairs(targets) do
if IsValid(trg) then
local ply2 = player.GetHumans()
for k, play in pairs(ply2) do
if IsValid(play) then
if table.HasValue(targets , play) then
net.Start("cappanel")
net.Send(play)
if table.HasValue(self.TEAM_1_ULX , play:GetUserGroup()) == true then
self.TEAM1NearCP = true
else
self.TEAM1NearCP = false
end
if table.HasValue(self.TEAM_2_ULX , play:GetUserGroup()) == true then
self.TEAM2NearCP = true
else
self.TEAM2NearCP = false
end
else
self.TEAM1NearCP = false
self.TEAM2NearCP = false
if ( self.Delay > CurTime() ) then return end
end
end
end
end
end
end



function ENT:Capture()
if self.initval == self.captval and self.teamcontrolled ~= "TEAM_1" then
self.teamcontrolled = "TEAM_1"
PrintMessage( 3, "The " .. file.Read("cpteam1.txt") .. " has captured a command post!" )
local logo = ents.Create( "prop_dynamic" )
logo:SetModel("models/props/cp/cislogo.mdl")
logo:SetPos(self:GetPos() + self:GetUp() * 100)
logo:SetAngles(self:GetAngles())
logo:SetParent(self)
logo:Spawn()
logo:Activate()
logo:SetName("commandpostlogo")
for k , v in pairs(ents.FindByClass( "prop_dynamic" )) do
if v:GetParent() == self then
v:SetColor(Color(255,0,0))
end
end
end
if self.initval == -(self.captval) and self.teamcontrolled ~= "TEAM_2" then
self.teamcontrolled = "TEAM_2"
PrintMessage( 3, "The " .. file.Read("cpteam2.txt") .. " has captured a command post!" )
local logo = ents.Create( "prop_dynamic" )
logo:SetModel("models/props/cp/republiclogo.mdl")
logo:SetPos(self:GetPos() + self:GetUp() * 100)
logo:SetAngles(self:GetAngles())
logo:SetParent(self)
logo:Spawn()
logo:Activate()
logo:SetName("commandpostlogo")
for k , v in pairs(ents.FindByClass( "prop_dynamic" )) do
if v:GetParent() == self then
v:SetColor(Color(0,0,255))
end
end
end
if self.initval == 0 then
if self.teamcontrolled == "TEAM_1" then
PrintMessage( 3, "The " .. file.Read("cpteam1.txt") .. " has lost a command post!" )
elseif self.teamcontrolled == "TEAM_2" then
PrintMessage( 3, "The " .. file.Read("cpteam2.txt") .. " has lost a command post!" )
end
self.teamcontrolled = "none"
for k, v in pairs(ents.FindByClass( "prop_dynamic" )) do
if v:GetParent() == self then
v:SetColor(Color(255,255,255))
if v:GetName() == "commandpostlogo" then
v:Remove()
end
end
end
end
if self.TEAM1NearCP == true and self.teamcontrolled == "TEAM_2" and self.capturable == true then
if self.initval < self.captval then
self.initval = self.initval + 1
end
end
if self.TEAM1NearCP == true and self.TEAM2NearCP == false and self.capturable == true and self.teamcontrolled == "none" then
if self.initval < self.captval then
self.initval = self.initval + 1
end
end
if self.TEAM2NearCP == true and self.TEAM1NearCP == false and self.capturable == true and self.teamcontrolled == "none" then
if self.initval > -(self.captval) then
self.initval = self.initval - 1
end
end
if self.TEAM2NearCP == true and self.teamcontrolled == "TEAM_1" and self.capturable == true then
if self.initval > -(self.captval) then
self.initval = self.initval - 1
end
end
if self.TEAM2NearCP == false and self.TEAM1NearCP == false and self.teamcontrolled == "none" and self.capturable == true then
if self.initval > 0 then
self.initval = self.initval - 1
end
if self.initval < 0 then
self.initval = self.initval + 1
end
end
end

function ENT:Use( activator , Caller )
if Caller:IsPlayer() then
local job = Caller:getDarkRPVar("job")
if self.capturetype == "Jobs" then
if (table.HasValue(self.TEAM_1 , job) and self.teamcontrolled == "TEAM_1") then
if self.CanTeleportFrom == true then
net.Start( "dopanel" );
net.WriteString(self.TEAM_1_NAME)
net.WriteTable(self.TEAM_1);
net.WriteFloat(0)
net.Send( Caller );
elseif self.CanTeleportFrom == false then
Caller:ChatPrint("Teleporting from this command post has been disabled!")
end
elseif (table.HasValue(self.TEAM_1 , job) and self.teamcontrolled != "TEAM_1") then
Caller:ChatPrint("Your team does not control this command post!")
end
if (table.HasValue(self.TEAM_2 , job) and self.teamcontrolled == "TEAM_2") then
if self.CanTeleportFrom == true then
net.Start( "dopanel" );
net.WriteString(self.TEAM_2_NAME)
net.WriteTable(self.TEAM_2);
net.WriteFloat(0)
net.Send( Caller );
elseif self.CanTeleportFrom == false then
Caller:ChatPrint("Teleporting from this command post has been disabled!")
end
elseif (table.HasValue(self.TEAM_2 , job) and self.teamcontrolled != "TEAM_2") then
Caller:ChatPrint("Your team does not control this command post!")
end
end
if self.capturetype == "ULX Groups" then
if (table.HasValue(self.TEAM_1_ULX , Caller:GetUserGroup()) and self.teamcontrolled == "TEAM_1") then
if self.CanTeleportFrom == true then
net.Start( "dopanel" );
net.WriteString(self.TEAM_1_NAME)
net.WriteTable(self.TEAM_1_ULX);
net.WriteFloat(1)
net.Send( Caller );
elseif self.CanTeleportFrom == false then
Caller:ChatPrint("Teleporting from this command post has been disabled!")
end
elseif (table.HasValue(self.TEAM_1_ULX , Caller:GetUserGroup()) and self.teamcontrolled != "TEAM_1") then
Caller:ChatPrint("Your team does not control this command post!")
end
if (table.HasValue(self.TEAM_2_ULX , Caller:GetUserGroup()) and self.teamcontrolled == "TEAM_2") then
if self.CanTeleportFrom == true then
net.Start( "dopanel" );
net.WriteString(self.TEAM_2_NAME)
net.WriteTable(self.TEAM_2_ULX);
net.WriteFloat(1)
net.Send( Caller );
elseif self.CanTeleportFrom == false then
Caller:ChatPrint("Teleporting from this command post has been disabled!")
end
elseif (table.HasValue(self.TEAM_2 , Caller:GetUserGroup()) and self.teamcontrolled != "TEAM_2") then
Caller:ChatPrint("Your team does not control this command post!")
end
end
end
end

net.Receive( "Teleport" , function(len , pl)
cpid2 = net.ReadEntity()
pl:SetPos(cpid2:GetPos() + Vector(math.random(50,100),math.random(50,100),50))
end)
Reply

#14

(Sunday, 04-06-2017, 03:04 AM)LVP Wrote: local ShouldSetOwner = false -- Set the entity's owner?

-------------------------------
AddCSLuaFile( "cl_init.lua" )
AddCSLuaFile( "shared.lua" )
include( 'shared.lua' )
-------------------------------
-- Add the names of all jobs that should be allowed to capture the command post. Add to ENT.TEAM1 for CIS, ENT.TEAM2 for Republic

ENT.initval = 0
ENT.captval = 5
ENT.captureradius = 100


function ENT:updateValue()
self.TEAM_1_NAME = file.Read("cpteam1.txt")
self.TEAM_2_NAME = file.Read("cpteam2.txt")
self.TEAM_1 = util.JSONToTable(file.Read("cpjoblist1.txt"))
self.TEAM_2 = util.JSONToTable(file.Read("cpjoblist2.txt"))
if self.teamcontrolled == "TEAM_1" then
self.TCString = file.Read("cpteam1.txt")
elseif self.teamcontrolled == "TEAM_2" then
self.TCString = file.Read("cpteam2.txt")
else
self.TCString = "None"
end
if self.CanTeleportTo == true then
self.CCTString = "Yes"
else
self.CCTString = "No"
end
self:SetCPName( self.cpname);
self:SetTeamControlled( self.TCString );  
self:SetCanTele(  self.CCTString );
self:SetJobList1( file.Read("cpjoblist1.txt") )
self:SetJobList2( file.Read("cpjoblist2.txt") )
self:SetJobName1( file.Read("cpteam1.txt") )
self:SetJobName2( file.Read("cpteam2.txt") )
self:SetInitval(  self.initval );
self:SetCaptval(  self.captval );
self:SetRadiuss(  self.captureradius );

end
--------------------
-- Spawn Function --
--------------------
function ENT:SpawnFunction( ply, tr )
end

----------------
-- Initialize --
----------------
function ENT:Initialize()
util.AddNetworkString( "dopanel" );
util.AddNetworkString( "cappanel" );
util.AddNetworkString( "Teleport" );
end

function ENT:Think()
self:updateValue()
if ( self.Delay > CurTime() ) then return end
self:Pingas()
self.Delay = CurTime() + 1
end

function ENT:Pingas()
local cps = ents.FindByClass("ent_commandpost")
for key, var in pairs (cps) do
var:Capture()
if self.capturetype == "Jobs" then
var:Detect()
end
if self.capturetype == "ULX Groups" then
var:DetectULX()
end
end
end

function ENT:Detect()
local targets = ents.FindInSphere(self:GetPos(), self.captureradius)
for k, trg in pairs(targets) do
if IsValid(trg) then
local ply2 = player.GetHumans()
for k, play in pairs(ply2) do
if IsValid(play) then
if table.HasValue(targets , play) then
local playerjob = play:getDarkRPVar("job")
net.Start("cappanel")
net.Send(play)
if table.HasValue(self.TEAM_1 , playerjob) == true then
self.TEAM1NearCP = true
else
self.TEAM1NearCP = false
end
if table.HasValue(self.TEAM_2 , playerjob) == true then
self.TEAM2NearCP = true
else
self.TEAM2NearCP = false
end
else
self.TEAM1NearCP = false
self.TEAM2NearCP = false
if ( self.Delay > CurTime() ) then return end
end
end
end
end
end
end

function ENT:DetectULX()
local targets = ents.FindInSphere(self:GetPos(), self.captureradius)
for k, trg in pairs(targets) do
if IsValid(trg) then
local ply2 = player.GetHumans()
for k, play in pairs(ply2) do
if IsValid(play) then
if table.HasValue(targets , play) then
net.Start("cappanel")
net.Send(play)
if table.HasValue(self.TEAM_1_ULX , play:GetUserGroup()) == true then
self.TEAM1NearCP = true
else
self.TEAM1NearCP = false
end
if table.HasValue(self.TEAM_2_ULX , play:GetUserGroup()) == true then
self.TEAM2NearCP = true
else
self.TEAM2NearCP = false
end
else
self.TEAM1NearCP = false
self.TEAM2NearCP = false
if ( self.Delay > CurTime() ) then return end
end
end
end
end
end
end



function ENT:Capture()
if self.initval == self.captval and self.teamcontrolled ~= "TEAM_1" then
self.teamcontrolled = "TEAM_1"
PrintMessage( 3, "The " .. file.Read("cpteam1.txt") .. " has captured a command post!" )
local logo = ents.Create( "prop_dynamic" )
logo:SetModel("models/props/cp/cislogo.mdl")
logo:SetPos(self:GetPos() + self:GetUp() * 100)
logo:SetAngles(self:GetAngles())
logo:SetParent(self)
logo:Spawn()
logo:Activate()
logo:SetName("commandpostlogo")
for k , v in pairs(ents.FindByClass( "prop_dynamic" )) do
if v:GetParent() == self then
v:SetColor(Color(255,0,0))
end
end
end
if self.initval == -(self.captval) and self.teamcontrolled ~= "TEAM_2" then
self.teamcontrolled = "TEAM_2"
PrintMessage( 3, "The " .. file.Read("cpteam2.txt") .. " has captured a command post!" )
local logo = ents.Create( "prop_dynamic" )
logo:SetModel("models/props/cp/republiclogo.mdl")
logo:SetPos(self:GetPos() + self:GetUp() * 100)
logo:SetAngles(self:GetAngles())
logo:SetParent(self)
logo:Spawn()
logo:Activate()
logo:SetName("commandpostlogo")
for k , v in pairs(ents.FindByClass( "prop_dynamic" )) do
if v:GetParent() == self then
v:SetColor(Color(0,0,255))
end
end
end
if self.initval == 0 then
if self.teamcontrolled == "TEAM_1" then
PrintMessage( 3, "The " .. file.Read("cpteam1.txt") .. " has lost a command post!" )
elseif self.teamcontrolled == "TEAM_2" then
PrintMessage( 3, "The " .. file.Read("cpteam2.txt") .. " has lost a command post!" )
end
self.teamcontrolled = "none"
for k, v in pairs(ents.FindByClass( "prop_dynamic" )) do
if v:GetParent() == self then
v:SetColor(Color(255,255,255))
if v:GetName() == "commandpostlogo" then
v:Remove()
end
end
end
end
if self.TEAM1NearCP == true and self.teamcontrolled == "TEAM_2" and self.capturable == true then
if self.initval < self.captval then
self.initval = self.initval + 1
end
end
if self.TEAM1NearCP == true and self.TEAM2NearCP == false and self.capturable == true and self.teamcontrolled == "none" then
if self.initval < self.captval then
self.initval = self.initval + 1
end
end
if self.TEAM2NearCP == true and self.TEAM1NearCP == false and self.capturable == true and self.teamcontrolled == "none" then
if self.initval > -(self.captval) then
self.initval = self.initval - 1
end
end
if self.TEAM2NearCP == true and self.teamcontrolled == "TEAM_1" and self.capturable == true then
if self.initval > -(self.captval) then
self.initval = self.initval - 1
end
end
if self.TEAM2NearCP == false and self.TEAM1NearCP == false and self.teamcontrolled == "none" and self.capturable == true then
if self.initval > 0 then
self.initval = self.initval - 1
end
if self.initval < 0 then
self.initval = self.initval + 1
end
end
end

function ENT:Use( activator , Caller )
if Caller:IsPlayer() then
local job = Caller:getDarkRPVar("job")
if self.capturetype == "Jobs" then
if (table.HasValue(self.TEAM_1 , job) and self.teamcontrolled == "TEAM_1") then
if self.CanTeleportFrom == true then
net.Start( "dopanel" );
net.WriteString(self.TEAM_1_NAME)
net.WriteTable(self.TEAM_1);
net.WriteFloat(0)
net.Send( Caller );
elseif self.CanTeleportFrom == false then
Caller:ChatPrint("Teleporting from this command post has been disabled!")
end
elseif (table.HasValue(self.TEAM_1 , job) and self.teamcontrolled != "TEAM_1") then
Caller:ChatPrint("Your team does not control this command post!")
end
if (table.HasValue(self.TEAM_2 , job) and self.teamcontrolled == "TEAM_2") then
if self.CanTeleportFrom == true then
net.Start( "dopanel" );
net.WriteString(self.TEAM_2_NAME)
net.WriteTable(self.TEAM_2);
net.WriteFloat(0)
net.Send( Caller );
elseif self.CanTeleportFrom == false then
Caller:ChatPrint("Teleporting from this command post has been disabled!")
end
elseif (table.HasValue(self.TEAM_2 , job) and self.teamcontrolled != "TEAM_2") then
Caller:ChatPrint("Your team does not control this command post!")
end
end
if self.capturetype == "ULX Groups" then
if (table.HasValue(self.TEAM_1_ULX , Caller:GetUserGroup()) and self.teamcontrolled == "TEAM_1") then
if self.CanTeleportFrom == true then
net.Start( "dopanel" );
net.WriteString(self.TEAM_1_NAME)
net.WriteTable(self.TEAM_1_ULX);
net.WriteFloat(1)
net.Send( Caller );
elseif self.CanTeleportFrom == false then
Caller:ChatPrint("Teleporting from this command post has been disabled!")
end
elseif (table.HasValue(self.TEAM_1_ULX , Caller:GetUserGroup()) and self.teamcontrolled != "TEAM_1") then
Caller:ChatPrint("Your team does not control this command post!")
end
if (table.HasValue(self.TEAM_2_ULX , Caller:GetUserGroup()) and self.teamcontrolled == "TEAM_2") then
if self.CanTeleportFrom == true then
net.Start( "dopanel" );
net.WriteString(self.TEAM_2_NAME)
net.WriteTable(self.TEAM_2_ULX);
net.WriteFloat(1)
net.Send( Caller );
elseif self.CanTeleportFrom == false then
Caller:ChatPrint("Teleporting from this command post has been disabled!")
end
elseif (table.HasValue(self.TEAM_2 , Caller:GetUserGroup()) and self.teamcontrolled != "TEAM_2") then
Caller:ChatPrint("Your team does not control this command post!")
end
end
end
end

net.Receive( "Teleport" , function(len , pl)
cpid2 = net.ReadEntity()
pl:SetPos(cpid2:GetPos() + Vector(math.random(50,100),math.random(50,100),50))
end)

boy wtf
I own the streets
Reply





Users browsing this thread:
1 Guest(s)