Guest User

Untitled

a guest
Nov 2nd, 2015
287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.59 KB | None | 0 0
  1. #hide_me
  2.  
  3. require 'mail'
  4.  
  5. #send_emails = 'no'
  6. send_emails = 'yes'
  7.  
  8. options = { :address => "smtp.gmail.com",
  9. :port => 587,
  10. :domain => 'gmail.com',
  11. :user_name => 'gemstoneruby.smtp',
  12. :password => 'Rubygemstone123!#',
  13. :authentication => 'plain',
  14. :enable_starttls_auto => true }
  15.  
  16. Mail.defaults do
  17. delivery_method :smtp, options
  18. end
  19.  
  20. dangertriggers = /(ignor|continu|\btyp(e[sd]?|ing)\b|hello|respond|reply|answer|speak|spoken|whisper|scream|\bSEND\b|aloud|talk|\bscript(s?|ing|ed)\b|smil|frown|snort|\byell\b|exclaim|announc|declar|voic|say|claim|boom|shout|this place|you there|squeak|spider|alert|cheer|nod|jump|wav|stop|attention|\bsilver[s]?\b|responsive|wrong|spider|monkey|mouse|\brat\b|frog|demand)/i
  21.  
  22. ## *** Set room numbers for your city if not listed here.
  23. rivers_rest_rooms = /10863|10911|10949|10992|10915|10863|10935|11002/
  24. fwi_rooms = /3672|16349|12306|16363|3654|3845|16470/
  25. landing_rooms = /XXXX/
  26. icemule_rooms = /XXXX/
  27. solhaven_rooms = /XXXX/
  28. tavaalor_rooms = /13930|13943|13938|10327|10379|10329|10325|10396|10364|10332/
  29. teras_rooms = /5906|3727|3483|1957|1851|1838|1885|1886|1932|12511|1957/
  30.  
  31. always_ignore_rooms = /#{rivers_rest_rooms}|#{fwi_rooms}|#{landing_rooms}|#{icemule_rooms}|#{solhaven_rooms}|#{tavaalor_rooms}|#{teras_rooms}/
  32.  
  33. ## *** Insert any known script triggers here, these will ALWAYS fire.
  34. prior_script_triggers = /^A sudden fierce gust|gruff voice|SEND|^You are buffeted|tell me|please respond|fairy|whatcha doin[g]?|^You hear someone applauding|^Roundtime changed to|^The ground begins to shake violently, making it hard to|answer that voice|what is wrong|how many silvers/i
  35.  
  36. ## ** Need to update these with additional magic casting
  37. ignore_magic_lines = /^\w+ (gestures while|makes a nearly)/
  38.  
  39. ## ** These are going to be specific to the creature/areas. Some will pop the line when not needed.
  40. always_ignore_strings = /#{ignore_magic_lines}|^[A|An] \w+ centaur ranger (snorts|notices)|^A sleek red squirrel hops nervously|^A rat skitters accross the ground near your feet|^You hear the booming|^You (pick|put|remove|tap|gather|swap|open|carefully)|^Running your fingers|^\w+ says, "Ah, so you're from|^Mana:|^With a quick flick of|^A crier hurries|^He continues, "Those citizens holding|^A jungle troll chieftain shouts, "Ird t'sum|^ With a satisfied rumble, it stalks off|^A fire giant shouts out|^A wave of dark ethereal|^You are buffeted by the dark|^As you place/
  41.  
  42. ## *** These lines ignore whole blocks. The first is combat, more lines likely needed here.
  43. ignore_start_lines_30wait = /(^You leap|^You make [a|an]|^You attempt to punch)/
  44. ignore_end_lines_30wait = /^Roundtime:/
  45.  
  46. ## *** Short 1 second blocks to ignore.
  47. ignore_start_lines_1wait = /(^\[[A-Z][a-z]|^You search |^ Maximum|^In the|^You rummage|^You are wearing|^ Skill Name|^Peering into)/
  48. ignore_end_lines_1wait = /^Obvious|^Total|^Click|^Further information|^Roundtime:/
  49.  
  50.  
  51. if $frontend == 'stormfront'
  52. fam_window_begin = "<pushStream id=\"familiar\" ifClosedStyle=\"watching\"/>"
  53. fam_window_end = "<popStream/>\r\n"
  54. else
  55. fam_window_begin = "\034GSe\r\n"
  56. fam_window_end = "\034GSf\r\n"
  57. end
  58.  
  59. while line = get
  60.  
  61. if line =~ prior_script_triggers
  62. puts("#{fam_window_begin}#{line}\r\n#{fam_window_end}")
  63. puts("#{fam_window_begin}Unrecognized game line.\r\n#{Time.at(Time.now).strftime("%B %e, %Y at %I:%M %p")}\n#{fam_window_end}")
  64.  
  65. if send_emails == 'yes'
  66. Mail.new(
  67. subject: 'Prior scriptcheck patterns detected.',
  68. body: "#{line}\r\nUnrecognized game line.\r\n#{Time.at(Time.now).strftime("%B %e, %Y at %I:%M %p")}\n"
  69. ).deliver!
  70. end
  71. end
  72.  
  73. if line =~ ignore_start_lines_30wait
  74. echo "Bypassing - 30 Wait, #{$1}"
  75. matchtimeout 30, ignore_end_lines_30wait
  76. next
  77. end
  78.  
  79. if line !~ /^\[Merchant|^\[Prime/ && line =~ ignore_start_lines_1wait
  80. echo "Bypassing - 1 Wait, #{$1}"
  81. matchtimeout 1, ignore_end_lines_1wait
  82. next
  83. end
  84.  
  85. next if Room.current.id.to_s =~ always_ignore_rooms
  86. next if line =~ always_ignore_strings
  87. next if line =~ /^\[.*?\]\-[A-z]+\:|^\[server\]\: "/
  88.  
  89. ### Checks for CAPITAL letters length 5 to 1000.
  90. if line =~ /([A-Z]{5,100})/ and line !~ /^Your SIGN OF ([A-Z]+)/ and line !~ /\s*(Strength|Constitution|Dexterity|Agility|Discipline|Aura|Logic|Intuition|Wisdom|Influence)\s+\((STR|CON|DEX|AGI|DIS|AUR|LOG|INT|WIS|INF)\)\:\s+\d+\s+\(-?\d+\)\s+\.\.\.\s+\d+\s+\(-?\d+\)/
  91. puts("#{fam_window_begin}#{line}\r\n#{fam_window_end}")
  92. puts("#{fam_window_begin}Unrecognized game line.\r\n#{Time.at(Time.now).strftime("%B %e, %Y at %I:%M %p")}\n#{fam_window_end}")
  93. if send_emails == 'yes'
  94. Mail.new(
  95. subject: 'Capital letters scriptcheck patterns detected.',
  96. body: "#{line}\r\nUnrecognized game line.\r\n#{Time.at(Time.now).strftime("%B %e, %Y at %I:%M %p")}\n"
  97. ).deliver!
  98. end
  99. end
  100.  
  101. if line =~ dangertriggers
  102. puts("#{fam_window_begin}#{line}\r\n#{fam_window_end}")
  103. puts("#{fam_window_begin}Unrecognized game line.\r\n#{Time.at(Time.now).strftime("%B %e, %Y at %I:%M %p")}\n#{fam_window_end}")
  104. if send_emails == 'yes'
  105. Mail.new(
  106. subject: 'Danger triggers scriptcheck patterns detected.',
  107. body: "#{line}\r\nUnrecognized game line.\r\n#{Time.at(Time.now).strftime("%B %e, %Y at %I:%M %p")}\n"
  108. ).deliver!
  109. end
  110. end
  111.  
  112. end
Advertisement
Add Comment
Please, Sign In to add comment