Pastebin
API
tools
faq
paste
Login
Sign up
Please fix the following errors:
New Paste
Syntax Highlighting
-- ...use with responsibility. -- -- Get with -- pastebin get n3K9Nt3D fakechat -- std PB n3K9Nt3D fakechat local names = { --Add names to quickly switch between using PageUP and PageDOWN { name = "&o&6Jesus", prefix = "<", suffix = "> ", }, { name = "&dServer", prefix = "&d[", suffix = "&d] ", msgprefix = "&d", realname = "But nobody" }, { name = "&eBagel&6Bot", prefix = "<", suffix = "> ", }, { name = "Lr_", prefix = "<", suffix = "> ", }, { name = "dan200", prefix = "<", suffix = "> ", }, } local sHistories = {} local cname = 1 local tArg = {...} local channel = 1251 --default 1251 local sHistory = {} local scr_x, scr_y = term.getSize() local modems local setModems = function() modems = {peripheral.find("modem")} for a = 1, #modems do if modems[a].isWireless() then modem = modems[a] modem.open(channel) return end end modem = nil end setModems() if (not commands) and (not modem) then return printError("You need a modem! Or a command computer!") end if commands then isServer = true else isServer = false end if (not commands) and (not modem) then error("This requires a command computer.") end local prefix = "" local suffix = "" local dnb = function(phunk, ...) local t,b = term.getTextColor(), term.getBackgroundColor() local x,y = term.getCursorPos() local output = {phunk(...)} term.setCursorPos(x,y) term.setTextColor(t) term.setBackgroundColor(b) return unpack(output) end local prevnames = {} local colnames = { ["0"] = "black", ["1"] = "dark_blue", ["2"] = "dark_green", ["3"] = "dark_aqua", ["4"] = "dark_red", ["5"] = "dark_purple", ["6"] = "gold", ["7"] = "gray", ["8"] = "dark_gray", ["9"] = "blue", ["a"] = "green", ["b"] = "aqua", ["c"] = "red", ["d"] = "light_purple", ["e"] = "yellow", ["f"] = "white", } local colors_names = { --for use with colors api, you see ["0"] = colors.black, ["1"] = colors.blue, ["2"] = colors.green, ["3"] = colors.cyan, ["4"] = colors.red, ["5"] = colors.purple, ["6"] = colors.orange, ["7"] = colors.lightGray, ["8"] = colors.gray, ["9"] = colors.blue, --they don't translate perfectly, okay?? ["a"] = colors.lime, ["b"] = colors.lightBlue, ["c"] = colors.red, ["d"] = colors.magenta, ["e"] = colors.yellow, ["f"] = colors.white, } local codeNames = { --just for checking ["k"] = "obfuscate", ["o"] = "italic", ["l"] = "bold", ["m"] = "strikethrough", ["n"] = "underline", ["r"] = "reset", } local filterColors = function(str,doprint) local p = 1 local output = "" local code = "&" local col = "f" local prevT,prevB = term.getTextColor(), term.getBackgroundColor() while p <= #str do if str:sub(p,p) == code then if colors_names[str:sub(p+1,p+1)] then col = str:sub(p+1,p+1) p = p + 1 elseif codeNames[str:sub(p+1,p+1)] then if str:sub(p+1,p+1) == "r" then col = "f" end p = p + 1 else if doprint then if term.isColor() then term.setTextColor(colors_names[col]) end write(str:sub(p,p)) end end p = p + 1 else output = output..str:sub(p,p) if doprint then if term.isColor() then term.setTextColor(colors_names[col]) end write(str:sub(p,p)) end p = p + 1 end end term.setTextColor(prevT) term.setBackgroundColor(prevB) return output end local renderReadBar = function(doReturn) local cx,cy = term.getCursorPos() local cb,ct = term.getBackgroundColor(), term.getTextColor() term.setCursorPos(1,scr_y) term.setBackgroundColor(colors.black) term.clearLine() filterColors(prefix.."&r"..names[cname].prefix.."&r"..names[cname].name.."&r"..names[cname].suffix.."&r"..suffix,true) term.setCursorPos(1,scr_y-1) if not doReturn then term.setBackgroundColor(colors.gray) term.clearLine() term.setTextColor(colors.white) else term.setCursorPos(cx,cy) term.setBackgroundColor(cb) term.setTextColor(ct) end end local colorFormat = function(str) local color = "f" local obfuscated = false local bold = false local strikethrough = false local underline = false local italic = false local code = "&" --ONE CHARACTER local pos = 1 local opos = 1 local output = {} while pos <= #str do output[opos] = {} if str:sub(pos,pos) == code and pos < #str then local changed = false if colnames[str:sub(pos+1,pos+1)] then color = str:sub(pos+1,pos+1) changed = true else if str:sub(pos+1,pos+1) == "r" then color = "f" obfuscated = false bold = false strikethrough = false underline = false italic = false changed = true end if str:sub(pos+1,pos+1) == "k" then obfuscated = true changed = true end if str:sub(pos+1,pos+1) == "l" then bold = true changed = true end if str:sub(pos+1,pos+1) == "m" then strikethrough = true changed = true end if str:sub(pos+1,pos+1) == "n" then underline = true changed = true end if str:sub(pos+1,pos+1) == "o" then italic = true changed = true end end if changed then output[opos].text = "" pos = pos + 2 else output[opos].text = str:sub(pos,pos) pos = pos + 1 end else output[opos].text = str:sub(pos,pos) pos = pos + 1 end output[opos].color = colnames[color] output[opos].obfuscated = obfuscated output[opos].bold = bold output[opos].strikethrough = strikethrough output[opos].underline = underline output[opos].italic = italic opos = opos + 1 end return textutils.serialiseJSON(output) end local players = { --Add playernames here if you want to filter who receives messages "dan200", "EldidiStroyrr", } local doFilter = false --If true, filters according to 'players' table local send = function(name,msg,np,ns,realname,doprint) local compiled --compiled message, not compiled program local filtmsg = filterColors(msg) if filtmsg:sub(1,3) == "___" then --should this be a client option? hmm... if filtmsg == "___join" then compiled = "&e"..filterColors(realname).." joined the game." elseif filtmsg == "___notjoin" then compiled = "&e"..filterColors(realname).." hasn't joined the game." elseif filtmsg == "___leave" then compiled = "&e"..filterColors(realname).." left the game." elseif filtmsg == "___notleave" then compiled = "&e"..filterColors(realname).." hasn't left the game." elseif filtmsg:sub(1,8) == "___medal" then compiled = realname.."&r has made the achievement &a["..msg:sub(10).."&a]" else compiled = msg:sub(4) end else compiled = prefix.."&r"..np.."&r"..name.."&r"..ns.."&r"..suffix.."&r"..msg end compiled = colorFormat(compiled) if doFilter then for a = 1, #players do commands.tellraw(players[a],compiled) end else commands.tellraw("@a",compiled) end end local netsend = function(n,m,p,s,mp,rn) --name, message, prefix, suffix local data = { name = n, realname = rn or n, msg = mp..m, prefix = p or "<", suffix = s or "> ", } if modem then modem.transmit(channel,channel,data) end end term.setBackgroundColor(colors.black) term.clear() term.setCursorPos(1,1) local name if tArg[1] then name = tArg[1] if name:gsub(" ","") ~= "" and prevnames[#prevnames] ~= name then table.insert(prevnames,name) end else print("Enter a name:") write(">") dnb(function() write("\n\nUse PageUP and PageDOWN to switch names.\nDo '/exit' to exit.\nDo '___join' or '___leave' to simulate doing either.\nPrefix any other message with '___' to do raw chat.\n\nUse responsibly") if term.isColor() then print(".") else print(", and it'd be preferable to use a golden computer. Not required, but...") end end) name = read(nil,prevnames) if name:gsub(" ","") ~= "" and prevnames[#prevnames] ~= name then table.insert(prevnames,name) end end if name:gsub(" ","") == "" then name = "Scabby cunt" end --enter in a fucking name table.insert(names,1,{ name = name, prefix = "<", suffix = "> ", realname = name }) local insend = function(n,m,p,s,mp,rn) --name, message, prefix, suffix. Sends a message inwards to simulate receiving a message from a client local data = { name = n, realname = rn or n, msg = mp..m, prefix = p or "<", suffix = s or "> ", } os.queueEvent("modem_message","top",channel,channel,data,0) end local client = function() --this is where you enter in your awesome messages! it also happens to be where *you* enter in your shitty messages while true do term.setBackgroundColor(colors.black) --dats rasist term.clear() renderReadBar() write(">") local msg = read(nil,sHistories[cname] or {"I like to eat pubes I find in urinals.","One of my hobbies is to kick small dogs and see how far they go.","Have you reddit","My child-sized skin suit it starting to smell."}) if msg:gsub(" ","") == "/exit" then return end if msg:gsub(" ","") ~= "" then if not sHistories[cname] then sHistories[cname] = {msg} else if sHistories[cname][#sHistories[cname]] ~= msg then sHistories[cname][#sHistories[cname]+1] = msg end end end if isServer then --if you are a command computer, fuck that netsend() function!!! that's for pussies!! if msg:gsub(" ","") ~= "" then local sdata = { names[cname].name, msg, prefix..names[cname].prefix or "<", suffix..names[cname].suffix or "> ", names[cname].msgprefix or "", } if type(names[cname].realname) == "string" then table.insert(sdata,names[cname].realname) end insend(unpack(sdata)) end else --if you're a client, studies have shown that you're the type of fuck who makes positive acronyms out of insults that are thrown your way local sdata = { names[cname].name, msg, prefix..names[cname].prefix or "<", suffix..names[cname].suffix or "> ", names[cname].msgprefix or "", } if type(names[cname].realname) == "string" then table.insert(sdata,names[cname].realname) end netsend(unpack(sdata)) end end end local renderHistory = function() --this shows all the latest and greatest (optional) messages sent by fakechat clients! local y = scr_y-2 local r = "&r" term.setBackgroundColor(colors.black) for a = #sHistory, #sHistory-(scr_y-2), -1 do if not sHistory[a] then break end term.setCursorPos(1,y) term.clearLine() filterColors(sHistory[a].p..r..sHistory[a].n..r..sHistory[a].s..r..sHistory[a].m,true) y = y - 1 end end local server = function() --now THIS is what I call a quality function! servers are where it's at! *it* being command computers, of course... while true do local evt = {os.pullEvent("modem_message")} if type(evt[5]) == "table" then local i = evt[5] if type(i.name) == "string" and type(i.msg) == "string" and type(i.prefix) == "string" and type(i.suffix) == "string" and type(i.realname) == "string" then table.insert(sHistory,{n=i.name, m=i.msg, p=i.prefix, s=i.suffix}) send( i.name, i.msg, i.prefix, i.suffix, i.realname, true) dnb(function() return renderHistory() end) end end end end moreModems = function() --keep them modems loaded! while true do setModems() sleep(0) end end switchNames = function() --in case you happen to be named harry kuntz, and want to change that right away local evt, key, rerender while true do rerender = false evt, key = os.pullEvent("key") if key == keys.pageUp then cname = cname - 1 rerender = true elseif key == keys.pageDown then cname = cname + 1 rerender = true end if cname <= 0 then cname = #names elseif cname > #names then cname = 1 end if rerender then renderReadBar(true) end end end local funclist = { --this is the funciest list I've ever laid eyes upon client, moreModems, switchNames, } if isServer then table.insert(funclist,server) end --clients are not servers, you thick idiot parallel.waitForAny(unpack(funclist)) --execute the SHIT out of this! term.setCursorPos(1,scr_y) term.setBackgroundColor(colors.black) term.clearLine() --the last line is always the hardest...*sniffle*
Optional Paste Settings
Category:
None
Cryptocurrency
Cybersecurity
Fixit
Food
Gaming
Haiku
Help
History
Housing
Jokes
Legal
Money
Movies
Music
Pets
Photo
Science
Software
Source Code
Spirit
Sports
Travel
TV
Writing
Tags:
Syntax Highlighting:
None
Bash
C
C#
C++
CSS
HTML
JSON
Java
JavaScript
Lua
Markdown (PRO members only)
Objective C
PHP
Perl
Python
Ruby
Swift
4CS
6502 ACME Cross Assembler
6502 Kick Assembler
6502 TASM/64TASS
ABAP
AIMMS
ALGOL 68
APT Sources
ARM
ASM (NASM)
ASP
ActionScript
ActionScript 3
Ada
Apache Log
AppleScript
Arduino
Asymptote
AutoIt
Autohotkey
Avisynth
Awk
BASCOM AVR
BNF
BOO
Bash
Basic4GL
Batch
BibTeX
Blitz Basic
Blitz3D
BlitzMax
BrainFuck
C
C (WinAPI)
C Intermediate Language
C for Macs
C#
C++
C++ (WinAPI)
C++ (with Qt extensions)
C: Loadrunner
CAD DCL
CAD Lisp
CFDG
CMake
COBOL
CSS
Ceylon
ChaiScript
Chapel
Clojure
Clone C
Clone C++
CoffeeScript
ColdFusion
Cuesheet
D
DCL
DCPU-16
DCS
DIV
DOT
Dart
Delphi
Delphi Prism (Oxygene)
Diff
E
ECMAScript
EPC
Easytrieve
Eiffel
Email
Erlang
Euphoria
F#
FO Language
Falcon
Filemaker
Formula One
Fortran
FreeBasic
FreeSWITCH
GAMBAS
GDB
GDScript
Game Maker
Genero
Genie
GetText
Go
Godot GLSL
Groovy
GwBasic
HQ9 Plus
HTML
HTML 5
Haskell
Haxe
HicEst
IDL
INI file
INTERCAL
IO
ISPF Panel Definition
Icon
Inno Script
J
JCL
JSON
Java
Java 5
JavaScript
Julia
KSP (Kontakt Script)
KiXtart
Kotlin
LDIF
LLVM
LOL Code
LScript
Latex
Liberty BASIC
Linden Scripting
Lisp
Loco Basic
Logtalk
Lotus Formulas
Lotus Script
Lua
M68000 Assembler
MIX Assembler
MK-61/52
MPASM
MXML
MagikSF
Make
MapBasic
Markdown (PRO members only)
MatLab
Mercury
MetaPost
Modula 2
Modula 3
Motorola 68000 HiSoft Dev
MySQL
Nagios
NetRexx
Nginx
Nim
NullSoft Installer
OCaml
OCaml Brief
Oberon 2
Objeck Programming Langua
Objective C
Octave
Open Object Rexx
OpenBSD PACKET FILTER
OpenGL Shading
Openoffice BASIC
Oracle 11
Oracle 8
Oz
PARI/GP
PCRE
PHP
PHP Brief
PL/I
PL/SQL
POV-Ray
ParaSail
Pascal
Pawn
Per
Perl
Perl 6
Phix
Pic 16
Pike
Pixel Bender
PostScript
PostgreSQL
PowerBuilder
PowerShell
ProFTPd
Progress
Prolog
Properties
ProvideX
Puppet
PureBasic
PyCon
Python
Python for S60
QBasic
QML
R
RBScript
REBOL
REG
RPM Spec
Racket
Rails
Rexx
Robots
Roff Manpage
Ruby
Ruby Gnuplot
Rust
SAS
SCL
SPARK
SPARQL
SQF
SQL
SSH Config
Scala
Scheme
Scilab
SdlBasic
Smalltalk
Smarty
StandardML
StoneScript
SuperCollider
Swift
SystemVerilog
T-SQL
TCL
TeXgraph
Tera Term
TypeScript
TypoScript
UPC
Unicon
UnrealScript
Urbi
VB.NET
VBScript
VHDL
VIM
Vala
Vedit
VeriLog
Visual Pro Log
VisualBasic
VisualFoxPro
WHOIS
WhiteSpace
Winbatch
XBasic
XML
XPP
Xojo
Xorg Config
YAML
YARA
Z80 Assembler
ZXBasic
autoconf
jQuery
mIRC
newLISP
q/kdb+
thinBasic
Paste Expiration:
Never
Burn after read
10 Minutes
1 Hour
1 Day
1 Week
2 Weeks
1 Month
6 Months
1 Year
Paste Exposure:
Public
Unlisted
Private
Folder:
(members only)
Password
NEW
Enabled
Disabled
Burn after read
NEW
Paste Name / Title:
Create New Paste
Hello
Guest
Sign Up
or
Login
Sign in with Facebook
Sign in with Twitter
Sign in with Google
You are currently not logged in, this means you can not edit or delete anything you paste.
Sign Up
or
Login
Public Pastes
✅ QUICK $1,500 IN 2 HOURS ✅
JavaScript | 3 min ago | 0.67 KB
⭐⭐ Free Crypto Method ⭐ ⭐⭐
JavaScript | 3 min ago | 0.67 KB
⭐⭐ FREE BTC GUIDE ✅ Working ⭐⭐
JavaScript | 7 min ago | 0.67 KB
🎯🎯 +50,000$ in 1 month⭐ 🎯🎯
JavaScript | 8 min ago | 0.67 KB
⭐⭐ INSTANT MONEY EXPLOIT ⭐⭐ ✅
JavaScript | 11 min ago | 0.67 KB
⚡ Earn 8,000$ Monthly Leaked Guide 🎯⭐
JavaScript | 14 min ago | 0.67 KB
⭐⭐ Crypto Swap Glitch ✅ Easy money ⭐⭐
JavaScript | 15 min ago | 0.67 KB
💎 2OOO$ 15 MIN INSANE METHOD 💵🚨 ✅✅
JavaScript | 19 min ago | 0.67 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!