Pastebin
API
tools
faq
paste
Login
Sign up
Please fix the following errors:
New Paste
Syntax Highlighting
/* Irc Echo Script by megdaOnE */ //---- Irc Data ---- const BotName = "AOSB"; const BotPass = "Admin"; const IRCServerIP = "85.17.189.153"; const IRCServerPort = 6667; const EchoChannel = "#asdafd"; const EchoPass = ""; const USER = 1; const VOICE = 2; const HALFOP = 3; const OP = 4; const SOP = 5; const OWNER = 6; local IRCNicks = {}; //---- Functions ---- function LoadIRCEcho() { IRCBot <- NewSocket( "IRCProcess" ); IRCBot.Connect( IRCServerIP, IRCServerPort ); IRCBot.SetNewConnFunc( "IRCLogin" ); } function IRCProcess( Data ) { local params = split( Data, " " ); local Count = params.len(), Nick, Cmd, Prefix, Channel = EchoChannel; if ( params[ 0 ] == "PING" ) { SendSMsg( "PONG " + params[ 1 ] + "\n" ); SendSMsg( "NAMES :" + EchoChannel + "\n" ); } if ( params[ 1 ] == "353" ) IRCSaveNicks( Data ); else if ( params[ 1 ] == "MODE" || params[ 1 ] == "NICK" || params[ 1 ] == "JOIN" || params[ 1 ] == "PART" || params[ 1 ] == "QUIT" ) SendSMsg( "NAMES :" + EchoChannel + "\n" ); if ( params[ 1 ] == "PRIVMSG" && params[ 2 ].tolower() == Channel.tolower() ) { if ( params[ 2 ].find( "#" ) == null ) return null; else { Nick = split( Data, "!" )[ 0 ].slice( 1 ); Cmd = params[ 3 ]; Prefix = Cmd.slice( 1, 2 ); Cmd = Cmd.slice( 2 ).tolower(); if ( Count > 4 && Prefix == "!" ) IRCCommands( Nick, Cmd, Data.slice( Data.find( Cmd ) + ( Cmd.len() + 1 ) ) ); else if ( Count == 4 && Prefix == "!" ) IRCCommands( Nick, split( Cmd, "\r\n" )[ 0 ], null ); } } else if ( params[ 1 ] == "KICK" && params[ 2 ].tolower() == Channel.tolower() ) SendSMsg( "JOIN " + Channel + " " + EchoPass + "\n" ); else if ( params[ 1 ] == "001" ) { SendSMsg( "PRIVMSG NICKSERV IDENTIFY " + BotPass + "\n" ); SendSMsg( "JOIN " + EchoChannel + " " + EchoPass + "\n" ); } } function IRCLogin() { SendSMsg( "USER " + BotName + " 0 * : " + BotName + " \n" ); SendSMsg( "NICK " + BotName + "\n" ); SendSMsg( "PRIVMSG NickServ IDENTIFY " + BotPass + "\n" ); SendSMsg( "MODE " + BotName + " +B\n" ); } function EchoMessage( text ) { SendSMsg( "PRIVMSG " + EchoChannel + " " + text + "\n" ); } function EMessage( text ) { EchoMessage( text ); Message( text.slice( 3 ) ); } /*function EMessage( text, ... ) { EchoMessage( text ); if ( vargv.len() < 1 ) Message( text.slice( 3 ) ); else Message( text.slice( 3 ), vargv[ 0 ] ); }*/ function UnloadIRCEcho() { if ( IRCBot ) { SendSMsg( "QUIT " + BotName + "\n" ); IRCBot.Delete(); } } function SendSMsg( msg ) { try { if ( IRCBot ) IRCBot.Send( msg ); } catch(E) { print( "Error Sending a message to the socket: " + E ); return 1; } } function IRCCommands( Nick, cmd, text ) { local UserInfo, level, params; if ( !IRCNicks.rawin( Nick ) ) { IRCNewNick( Nick, 1 ); level = 1; } else { UserInfo = IRCNicks[ Nick ]; level = UserInfo.Level.tointeger(); } if ( text ) text = text.slice( 0, text.len() - 2 ); if ( cmd == "say" ) { if ( !text ) EchoMessage( "**4 Error - Correct Syntax:5 !" + cmd + " <Text>" ); else EMessage( "12>> IRC: [" + GetIRCLevel( level ) + "] " + Nick + ": " + text + "." ); } else if ( cmd == "ping" ) { if ( !text ) EchoMessage( "**4 Error - Correct Syntax:5 !" + cmd + " <nick/id>" ); { local param = split( text, " " ), plr = GetPlayer( param[ 0 ] ); if ( !plr ) EchoMessage( "4[Error] >> " + param[ 0 ] + " isn't connected." ); else EchoMessage( "7>> Ping " + plr.Name + " - " + plr.Ping + "." ); } } else if ( cmd == "players" ) { local b = null; for ( local a = 0; a < GetMaxPlayers(); a ++ ) { local plr = FindPlayer( a ); if ( plr ) { if ( b ) b = b + " - 5" + plr.Name + " 14 [" + plr.ID + "]"; else b = plr.Name + " 14[" + plr.ID + "]"; } } if ( b ) EchoMessage( "**2 Players Online: 5" + b ); else EchoMessage( "5There Aren't Players Online." ); } else if ( cmd == "admins" ) { local b = null; for ( local a = 0; a < GetMaxPlayers(); a ++ ) { local plr = FindPlayer( a ); if ( plr ) { if ( GetPlayerLevel( plr ) >= 6 ) { if ( b ) b = b + " - 13" + plr.Name + " 12[ " + LevelTag( GetPlayerLevel( plr ) ) + " ]"; else b = plr.Name + " 12[ " + LevelTag( GetPlayerLevel( plr ) ) + " ]"; } } } if ( b ) EchoMessage( "7>> Admins's: 13" + b ); else EchoMessage( "**5 No Admins Online." ); } else if ( cmd == "kick" ) { if ( level < 4 ) EchoMessage( "4>> Only players with level 4 [ " + GetIRCLevel( 4 ) + " ] or high, have acces to this command." ); else if ( !text ) EchoMessage( "6[Syntax] - The correct use: /c " + cmd + " <nick/id> <reason>." ); else { local txt = NumTok( text, " " ); if ( txt < 2 ) EchoMessage( "6[Syntax] - The correct use: /c " + cmd + " <nick/id> <reason>." ); else { local plr = GetPlayer( GetTok( text, " ", 1 ) ); if ( !plr ) EchoMessage( "6[Error] - Invalid nick/id, unknown player." ); else { Message( "12>> IRC Admin " + Nick + " Kicked: " + plr.Name + ", ID: " + plr.ID + ", Reason:[ " + GetTok( text, " ", 2, txt ) + " ]." ); KickPlayer( plr ); } } } } else if ( cmd == "ban" ) { if ( level < 5 ) EchoMessage( "4>> Only players with level 5 [ " + GetIRCLevel( 5 ) + " ] or high, have acces to this command." ); else if ( !text ) EchoMessage( "6[Syntax] - The correct use: /c " + cmd + " <nick/id> <reason>." ); else { local txt = NumTok( text, " " ); if ( txt < 2 ) EchoMessage( "6[Syntax] - The correct use: /c " + cmd + " <nick/id> <reason>." ); else { local plr = GetPlayer( GetTok( text, " ", 1 ) ); if ( !plr ) EchoMessage( "6[Error] - Invalid nick/id, unknown player." ); else { QuerySQL( SQLDataBase, format( "REPLACE INTO Banneds ( IP, Name, User, Data, ByAdmin, Reason ) VALUES ( '%s', '%s', '%s', '%s', '%s', '%s' )", plr.IP, plr.Name.tolower(), plr.Name, GetFullTime(), Nick , GetTok( text, " ", 2, txt ) ) ); EMessage( "12>> IRC Admin " + Nick + " Banned: " + plr.Name + ", ID: " + plr.ID + ", Reason:[ " + GetTok( text, " ", 2, txt ) + " ]." ); KickPlayer( plr ); } } } } else if ( cmd == "setlevel" ) { if ( level < 6 ) EchoMessage( "4>> Only players with level 6 [ " + GetIRCLevel( 6 ) + " ] or high, have acces to this command." ); else if ( !text ) EchoMessage( "6[Syntax] >> The correct use: " + cmd + " <nick/id> <level>." ); else { local txt = NumTok( text, " " ); if ( txt < 2 ) EchoMessage( "6[Syntax] >> The correct use: " + cmd + " <nick/id> <level>." ); else { local plr = GetPlayer( GetTok( text, " ", 1 ) ); if ( !plr ) EchoMessage( "6[Error] - Invalid Nick/ID, unknown player." ); else if ( !GetPlayerLevel( plr ) ) EchoMessage( "6[Error] - " + plr.Name + " not registered!" ); else { local lvl = GetTok( text, " ", 2, txt ); if ( !IsNum( lvl ) ) EchoMessage( "6[Error] - Invalid level, type numbers to level." ); else { SetPlayerLevel( plr, lvl.tointeger() ); EMessage( "12>> IRC Admin " + Nick + " set " + plr.Name + "'s level administration to [ " + lvl.tointeger() + " ] [ " + LevelTag( lvl.tointeger() ) + " ]." ); } } } } } else if ( cmd == "restart" ) { if ( level >= OP ) { EchoMessage( COL_RED + "***Restarting Echo Bot please wait some seconds***" ); NewTimer( "Reconnect", 1000, 1 ); } else EchoMessage( COL_RED + "Error - You don't have the needed level to restart the echo bot" ); } } function IRCSaveNicks( List ) { local a = NumTok( List, " " ), NickList = GetTok( List, " ", 6, a ), i = 1; local Nicks = split( NickList, " " ); while( Nicks[ i-1 ] != "366" ) { local nick = Nicks[ i-1 ].slice( 1 ), level = Nicks[ i-1 ].slice( 0, 1 ); if ( level == ":" ) { level = nick.slice( 0, 1 ); nick = nick.slice( 1 ); } if ( level == "+" ) IRCNewNick( nick, 2 ); else if ( level == "%" ) IRCNewNick( nick, 3 ); else if ( level == "@" ) IRCNewNick( nick, 4 ); else if ( level == "&" ) IRCNewNick( nick, 5 ); else if ( level == "~" ) IRCNewNick( nick, 6 ); else IRCNewNick( Nicks[ i-1 ], 1 ); i ++; } } function IRCNewNick( Name, Level ) { IRCNicks[ Name ] <- IRCNickz(); IRCNicks[ Name ].SaveNickInfo( Name, Level ); } class IRCNickz { Name = null; Level = 1; } function IRCNickz::SaveNickInfo( Nick, IRCLevel ) { Name = Nick; Level = IRCLevel; } function GetIRCLevel( Level ) { local Name = "User"; switch( Level ) { case 1: Name = "User"; break; case 2: Name = "Member"; break; case 3: Name = "Moderator"; break; case 4: Name = "Admin"; break; case 5: Name = "Management"; break; case 6: Name = "Owner Server"; break; } return Name; } function Reconnect() { UnloadIRCEcho(); NewTimer( "LoadIRCEcho", 1600, 1 ); }
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
Untitled
13 hours ago | 0.16 KB
settings
13 hours ago | 0.10 KB
IT & AI
23 hours ago | 1.62 KB
Stationeers - Sign Tags from Power Distributi...
HTML | 1 day ago | 2.00 KB
PM: Shopify Client Edits
1 day ago | 0.19 KB
PM: Shopify Assigning Design Task 2
1 day ago | 0.14 KB
PM: Shopify Assigning Design Task 1
1 day ago | 0.32 KB
Commodore Callback 8020
1 day ago | 0.18 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!