Useless.lua

View previous topic View next topic Go down

Useless.lua

Post by fredsmith on Tue Feb 01, 2011 11:28 pm

These were from a topic from the old-new forums... feel free to suggest new useless functions as a joke. Wink

Code:
-- By FredSmith
--[[ This Lua library is full of useless functions. They were all copied from the topic in the English Rigidchips Forum. Here is the URL: http://www.rigid-chips.com/forums/viewtopic.php?f=20&t=139 ]]--

function add(a,b)
   return a+b
end

function lag()
   for i=0,1000000000 do
      _MOVE3D(-I,-I,-I) _LINE3D(I,I,I)
   end
end

function return(a,b,c)
   return a,b,c
 end

function niller(a)
   a=nil
end

function bob()
end

function ask(a)
   for i=0,24 do
      out(i,"NO!")
   end
end

function wtf()
   for i=0,200 do
      out(i,i*385^i^i^i^i^i^i^i^i)
   end
end

function net()
   for i=-2,2,0.01 do
      _SETCOLOR(0)
      _MOVE2d(i,-2)
      _LINE2d(i,2)
      _MOVE2d(2,i)
      _LINE2d(-2,i)
   end
end

function denil(a)
   if a==nil then
      a=0
   end
end

function why()
   for i = 0, 2048, 1 do
      out(i, "Why would you even think about using this function?");
      out(i+1, "I mean, seriously... it's useless!");
   end
end

function noglue()
   for i = 0,_CHIPS()-1 do
      _BYE(i)
   end
end

function  keypress()
   for i=0,16 do
      if _KEY(i)==1 then
         out(i,"key ",i," pressed");
      end
   end
end

function dead()
   if _T(0)==-1 then
      out(1,"You are dead. Press [R] or [U] to respawn.")
   end
end

function sniper()
   timer = timer+1/_FPS()
   if timer<5 then
      out(1,"Wait for it...");
   elseif timer<10 then
      out(1,-timer+10);
   elseif timer<15 then
      out(1,"BAM! HEADSHOT!");
      noglue();
   elseif timer<17 then
      out(1,"You just got sniped!");
   else
      out(1,"You just got sniped!");
      out(2,"Press [R] or [U] to respawn.");
   end
end
avatar
fredsmith
Hover
Hover

Posts : 109
Join date : 2011-01-19
Location : Nowhere and everywhere.

View user profile http://lmgtfy.com/?q=rigidchips

Back to top Go down

Re: Useless.lua

Post by bwansy on Wed Feb 02, 2011 4:51 pm

Code:
function noiseless_track_player(id)
  x,y,z = _PLAYERX(id),+PLAYERY(id),_PLAYERZ(id)
  x = x+math.random(-1000,1000)
  y = y+math.random(-1000,1000)
  z = z+math.random(-1000,1000)
  return x,y,z
end

function supersonic()
  out(1,"Speed: Mach ",-_VZ()/10)
  out(20,"Yeah, speed of sound is now 10 m/s XD")
end

_________________
A.K.A. Bernard

bwansy
Admin

Posts : 170
Join date : 2010-07-15

View user profile http://rigidchips.forum-motion.com

Back to top Go down

Re: Useless.lua

Post by JHaskly on Wed Feb 02, 2011 11:38 pm

Code:
crash = function() out(0,{}) end

_________________
Previously (and currently) known as Juz.

Please do not write "LUA", beause it's "Lua". It's Moon in Portuguese, not a Limited User Account, Last Universal Ancestor, or the Lukla Airport in Nepal.

JHaskly
Admin

Posts : 235
Join date : 2010-07-16
Age : 21
Location : Brisbane

View user profile

Back to top Go down

Re: Useless.lua

Post by fredsmith on Thu Feb 03, 2011 5:01 pm

Code:
function annoyJuz()
    out(1,"it's LUA not Lua")
end

Sorry, just had to do that.
avatar
fredsmith
Hover
Hover

Posts : 109
Join date : 2011-01-19
Location : Nowhere and everywhere.

View user profile http://lmgtfy.com/?q=rigidchips

Back to top Go down

Re: Useless.lua

Post by JHaskly on Thu Feb 03, 2011 11:20 pm

Razz

_________________
Previously (and currently) known as Juz.

Please do not write "LUA", beause it's "Lua". It's Moon in Portuguese, not a Limited User Account, Last Universal Ancestor, or the Lukla Airport in Nepal.

JHaskly
Admin

Posts : 235
Join date : 2010-07-16
Age : 21
Location : Brisbane

View user profile

Back to top Go down

Re: Useless.lua

Post by fredsmith on Fri Feb 04, 2011 12:41 am

Code:
function repeat()
    local a="Hello there! How are you doing? I'm doing fine, thank you. What are you playing? Which model are you loading? I'll recommend you a good model, the Basic. It's really nice! It's a good car. It handles well and looks good too! No cowling, but I don't care about that. I see you've taken it out for a test drive. That's awesome! Well, "
    return a..a..a..a..a..a..a..a..a..a..a..a..a..a..a..a..a
end

function rant()
    out(1,repeat())
end
avatar
fredsmith
Hover
Hover

Posts : 109
Join date : 2011-01-19
Location : Nowhere and everywhere.

View user profile http://lmgtfy.com/?q=rigidchips

Back to top Go down

Re: Useless.lua

Post by MrSparks on Wed May 30, 2012 9:55 pm

Code:
function web() --draws a line between every chip and every other chip.
  for a=0,_CHIPS()-2 do
    for b=a+1,_CHIPS()-1 do
      _MOVE3D(_X(a),_Y(a),_Z(a))
      _LINE3D(_X(b),_Y(b),_Z(b))
    end
  end
end

Confession: I actually wrote a similar function for use as a variant of aiming reticule on the turret I'm currently finishing up.



Last edited by MrSparks on Wed May 30, 2012 9:59 pm; edited 1 time in total (Reason for editing : noticed slight inefficiency(ha!) in internal loop)

MrSparks
Tank
Tank

Posts : 73
Join date : 2012-01-05
Age : 27
Location : Michigan

View user profile

Back to top Go down

Re: Useless.lua

Post by Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum