Advertisement
Mouamle

reply

Feb 29th, 2016
415
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.42 KB | None | 0 0
  1.  
  2. -- some examples of how to use this :3
  3. ws[1] = "هلو" -- msg
  4. rs[1] = "هلوات حبي 😍" -- reply
  5.  
  6. ws[2] = "احبك" -- msg
  7. rs[2] = "امـوت بيـك/ج يروحي 😍🙊 " -- reply
  8.  
  9. ws[3] = "بوسني" -- msg
  10. rs[3] = "محـحـحــحـح ع الشفـه لسق 😍🙊" -- reply
  11.  
  12. ws[4] = "هكتور" -- msg
  13. rs[4] = "يـ نبضـات هكـتور 😍" -- reply
  14.  
  15. ws[5] = "منو ضافني" -- msg
  16. rs[5] = "عزرائـيل 🌝 " -- reply
  17.  
  18. ws[6] = "😂" -- msg
  19. rs[6] = "؟✟دٍّﯛٍْﯚٍْﯛٍْﯚٍْ۾ٍْ﴿✢🌹✢﴾ﻳـُِـٍّﮯٍّﺂِْڕٍّپّ✟"
  20.  
  21. ws[7] = "اريد كروب" -- msg
  22. rs[7] = "انتضـر المطور @x_s7s_x هسه يجي 😊❤️" -- reply
  23.  
  24. ws[8] = "تحبني" -- msg
  25. rs[8] = "عاشقك/ج بجنون 😌💋" -- reply
  26.  
  27. ws[9] = "تف" -- msg
  28. rs[9] = "تعكس اخلاقك/ج 😌🍂" -- reply
  29.  
  30. ws[10] = "وين المطور" -- msg
  31. rs[10] = "عنده شغل هسه يجي 😒 شكد تلح" -- reply
  32.  
  33. ws[11] = "محضور" -- msg
  34. rs[11] = "كسرت قلبي 😂" -- reply
  35.  
  36. ws[12] = "بوت فاشل" -- msg
  37. rs[12] = "☺️🍂 نفس خلقتك/ج يعمري" -- reply
  38.  
  39. ws[13] = "كروب فاشل" -- msg
  40. rs[13] = "اخذ نعالك واشطح 😒" -- reply
  41.  
  42. ws[14] = "@x_s7s_x" -- msg
  43. rs[14] = "المطور مالتي فديته هو صنعني 😍🌝" -- reply
  44.  
  45. ws[15] = "منو اني" -- msg
  46. rs[15] = "انـت روحـي 😍🙈" --reply
  47.  
  48. ws[15] = "هه" -- msg
  49. rs[15] = "صار ثكيل 😂 ع اساس هو فد شخصيه طط 🌝🍂" -- reply
  50.  
  51. ws[16] = "محظور" -- msg
  52. rs[16] = " كسرت قلبي 😂🍂" --- reply
  53.  
  54. ws[17] = "محضوره" -- msg
  55. rs[17] = "انطيني حلق وافكلج الحضر 😂💋" -- reply
  56.  
  57. ws[18] = "محظوره" -- msg
  58. rs[18] = "انطيني حلق وافكلج الحظر 😂💋" -- reply
  59.  
  60. ws[19] = "انجب" -- msg
  61. rs[19] = "؏ـﻳـ﴿😱﴾ـٻ. يامحترم/ـة 😒" -- reply
  62.  
  63. ws[20] = "اكلك" -- msg
  64. rs[20] = "كول/ـي حہۣۙ﴿❥﴾ﻴـااٌِتيْـﮱ 😊❤️" -- reply
  65.  
  66. ws[21] = "انجب لك" -- msg
  67. rs[21] = "😂😂 اوي قاسي/ـيـة"
  68.  
  69. -- the main function
  70. function run( msg, matches )
  71.  -- just a local variables that i used in my algorithm  
  72.  local i = 0; local w = false
  73.  
  74.  -- the main part that get the message that the user send and check if it equals to one of the words in the ws table :)
  75.  -- this section loops through all the words table and assign { k } to the word index and { v } to the word itself
  76.  for k,v in pairs(ws) do
  77.   -- change the message text to uppercase and the { v } value that toke form the { ws } table and than compare it in a specific pattern
  78.   if ( string.find(string.upper(msg.text), "^" .. string.upper(v) .. "$") ) then
  79.    -- assign the { i } to the index of the reply and the { w } to true ( we will use it later )
  80.    i = k; w = true;
  81.   end
  82.  end
  83.  
  84.  -- check if { w } is not false and { i } not equals to 0
  85.  if ( (w ~= false) and (i ~= 0) ) then
  86.   -- get the receiver :3
  87.   R = get_receiver(msg)
  88.   -- send him the proper message from the index that { i } assigned to
  89.   send_large_msg ( R , rs[i] );
  90.  end
  91.  
  92.  -- don't edit this section
  93.  if ( msg.text == "about" ) then
  94.   if ( msg.from.username == "Mouamle" ) then
  95.    R = get_receiver(msg)
  96.    send_large_msg ( R , "Made by @Mouamle" );
  97.   end
  98.  end
  99.  
  100. end
  101.  
  102.  
  103.  
  104. return {
  105.  patterns = {
  106.   "(.*)"  
  107.    },
  108.    run = run
  109. }
  110.  
  111.  
  112. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement