Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * @author Juntalis
- */
- var Parser =
- {
- Data : {
- Events:
- [
- {
- Name : "Bot.Loaded",
- Alias : "bot.start",
- ArgCount : 0,
- ArgValues : [],
- RegexCatch : /^TORIBASH\ 30$/m,
- RaiseEvent : function(event){}
- },
- {
- Name : "Bot.Ended",
- Alias : "bot.end",
- ArgCount : 0,
- ArgValues : [],
- RegexCatch : null,
- RaiseEvent : function(event){}
- },
- {
- Name : "Server.Message",
- Alias : "server.msg",
- ArgCount : 1,
- ArgValues :
- [
- {
- type : "String",
- alias : "msg"
- }
- ],
- RegexCatch : /^SAY\ 0;(.*?)$/m,
- RaiseEvent : function(event){}
- },
- {
- Name : "User.Join",
- Alias : "user.join",
- ArgCount : 1,
- ArgValues :
- [
- {
- type : "User",
- alias : "user"
- }
- ],
- RegexCatch : null,
- RaiseEvent : function(event){}
- },
- {
- Name : "User.Leave",
- Alias : "user.leave",
- ArgCount : 2,
- ArgValues :
- [
- {
- type : "User",
- alias : "user"
- },
- {
- type : "String",
- alias : "reason"
- }
- ],
- RegexCatch : /^DISCONNECT ([0-9]*?);(.*?) disconnected\.(.*?)$/m,
- RaiseEvent : function(event){}
- },
- {
- Name : "User.Say",
- Alias : "user.say",
- ArgCount : 2,
- ArgValues :
- [
- {
- type : "User",
- alias : "user"
- },
- {
- type : "String",
- alias : "msg"
- }
- ],
- RegexCatch : /^SAY\ ([0-9]*?);(.*?):\ (.*?)$/m,
- RaiseEvent : function(event){}
- },
- {
- Name : "User.Whisper",
- Alias : "user.whisper",
- ArgCount : 2,
- ArgValues :
- [
- {
- type : "User",
- alias : "user"
- },
- {
- type : "String",
- alias : "msg"
- }
- ],
- RegexCatch : /^WHISPER\ 0;\*(.*?):\ (.*?)$/m,
- RaiseEvent : function(event){}
- }
- ],
- Comparisons :
- [
- {
- Name : "Equals",
- Alias : "==",
- ArgumentTypes: "Any",
- Action : function(A,B) {
- return (A==B) ? true : false;
- },
- FlagsPossible : [ "RX", "IC" ]
- },
- {
- Name : "Not Equal",
- Alias : "!=",
- ArgumentTypes: "Any",
- Action : function(A,B) {
- return (A!=B) ? true : false;
- },
- FlagsPossible : [ "RX", "IC" ]
- },
- {
- Name : "Includes Anywhere",
- Alias : "*=",
- ArgumentTypes: "String",
- Action : function(A,B) {
- return (A.match(B) != null) ? true : false;
- },
- FlagsPossible : [ "IC", "RX", "SM"]
- },
- {
- Name : "Does Not Include Anywhere",
- Alias : "!*=",
- ArgumentTypes: "String",
- Action : function(A,B) {
- return (A.match(B) == null) ? true : false;
- },
- FlagsPossible : [ "IC", "RX"]
- },
- {
- Name : "Starts With",
- Alias : "^=",
- ArgumentTypes: "String",
- Action : function(A,B) {
- if (B.length > A.length) return false;
- return (A.substr(0,B.length) == B) ? true : false;
- },
- FlagsPossible : [ "IC", "RX"]
- },
- {
- Name : "Does Not Starts With",
- Alias : "!^=",
- ArgumentTypes: "String",
- Action : function(A,B) {
- if (B.length > A.length) return true;
- return (A.substr(0,B.length) != B) ? true : false;
- },
- FlagsPossible : [ "IC", "RX"]
- },
- {
- Name : "Ends With",
- Alias : "$=",
- ArgumentTypes: "String",
- Action : function(A,B) {
- if (B.length > A.length) return false;
- return (A.substr((B.length*(-1)),B.length) == B) ? true : false;
- },
- FlagsPossible : [ "IC", "RX"]
- },
- {
- Name : "Ends With",
- Alias : "!$=",
- ArgumentTypes: "String",
- Action : function(A,B) {
- if (B.length > A.length) return true;
- return (A.substr((B.length*(-1)),B.length) != B) ? true : false;
- },
- FlagsPossible : [ "IC", "RX"]
- },
- {
- Name : "Is Bigger Than",
- Alias : "!$=",
- ArgumentTypes: "Integer",
- Action : function(A,B) {
- return (A>B) ? true : false;
- },
- FlagsPossible : []
- },
- {
- Name : "Is Smaller Than",
- Alias : "!$=",
- ArgumentTypes: "Integer",
- Action : function(A,B) {
- return (A<B) ? true : false;
- },
- FlagsPossible : []
- }
- ],
- Flags :
- [
- {
- Name : "Ignore Case",
- Alias : "IC"
- },
- {
- Name : "Regular Expression",
- Alias : "RX"
- },
- {
- Name : "Single Match",
- Alias : "SM"
- }
- ],
- Methods :
- [
- {
- Name : "Say",
- Alias : "bot.say",
- ArgCount : 1,
- Arguments :
- [
- {
- name : "msg",
- type : "String"
- }
- ],
- Returns : null,
- Action : function(args){}
- },
- {
- Name : "Whisper User",
- Alias : "bot.whisper",
- ArgCount : 2,
- Arguments :
- [
- {
- name : "name",
- type : "String"
- },
- {
- name : "msg",
- type : "String"
- }
- ],
- Returns : null,
- Action : function(args){}
- },
- {
- Name : "Op User",
- Alias : "bot.op",
- ArgCount : 1,
- Arguments :
- [
- {
- name : "name",
- type : "String"
- }
- ],
- Returns : null,
- Action : function(args){}
- },
- {
- Name : "DeOp User",
- Alias : "bot.deop",
- ArgCount : 1,
- Arguments :
- [
- {
- name : "name",
- type : "String"
- }
- ],
- Returns : null,
- Action : function(args){}
- },
- {
- Name : "Kick User",
- Alias : "bot.kick",
- ArgCount : 1,
- Arguments :
- [
- {
- name : "name",
- type : "String"
- }
- ],
- Returns : null,
- Action : function(args){}
- },
- {
- Name : "Ban User",
- Alias : "bot.ban",
- ArgCount : 1,
- Arguments :
- [
- {
- name : "name",
- type : "String"
- }
- ],
- Returns : null,
- Action : function(args){}
- },
- {
- Name : "Centerprint",
- Alias : "bot.centerprint",
- ArgCount : 1,
- Arguments :
- [
- {
- name : "msg",
- type : "String"
- }
- ],
- Returns : null,
- Action : function(args){}
- },
- {
- Name : "HTTP Get",
- Alias : "http.get",
- ArgCount : 1,
- Arguments :
- [
- {
- name : "url",
- type : "String"
- }
- ],
- Returns : "String",
- Action : function(args){}
- },
- {
- Name : "HTTP Post",
- Alias : "http.post",
- ArgCount : 2,
- Arguments :
- [
- {
- name : "url",
- type : "String"
- },
- {
- name : "body",
- type : "String"
- }
- ],
- Returns : "String",
- Action : function(args){}
- },
- {
- Name : "Get MD5 Hash",
- Alias : "encode.md5",
- ArgCount : 1,
- Arguments :
- [
- {
- name : "str",
- type : "String"
- }
- ],
- Returns : "String",
- Action : function(args){}
- },
- {
- Name : "Base64 Encode",
- Alias : "encode.b64encode",
- ArgCount : 1,
- Arguments :
- [
- {
- name : "str",
- type : "String"
- }
- ],
- Returns : "String",
- Action : function(args){}
- },
- {
- Name : "Base64 Decode",
- Alias : "encode.b64decode",
- ArgCount : 1,
- Arguments :
- [
- {
- name : "str",
- type : "String"
- }
- ],
- Returns : "String",
- Action : function(args){}
- },
- ]
- },
- FormEvents : function()
- {
- $.each(Parser.Data.Events,
- function(index, value) {
- var tmpEvent = value.Name + ": ";
- tmpEvent += "function(objEvent)";
- console.log(tmpEvent);
- tmpEvent = "objEvent = { Integer ArgCount, ";
- if (value.ArgCount > 0) {
- for(i=0; i <= value.ArgCount - 1; i++ ) {
- tmpEvent += value.ArgValues[i].type;
- tmpEvent += " ";
- tmpEvent += value.ArgValues[i].alias;
- tmpEvent += ", ";
- }
- }
- tmpEvent += "String ReceivedLine}";
- console.log(tmpEvent);
- }
- );
- }
- };
Add Comment
Please, Sign In to add comment