Advertisement
ACheats

sber

Dec 15th, 2018
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.64 KB | None | 0 0
  1. local data = {}
  2. function CreateBalance(name,ammount)
  3.   data.ballance = ammount
  4.   data.rub = 0
  5.   data.lei = 0
  6.   data.btc = 0
  7.   setLocalData(name, data)
  8.   return "*Поздравляем! Вы открыли счет в сбербанке.\n Получите 100$ на ваш лицевой счет в подарок."
  9. end
  10. -------------------------------
  11. function ShowCheck(username)
  12.   local data = getLocalData(username)
  13.   local curs = getLocalData("curs")
  14. --  if data.rub == nil then data.rub = 0 end
  15.   local str = [[====Чек Сбербанка====
  16.   Ваше имя: ]] ..username .. "\n" .. [[
  17.   Баланс:]] .. data.ballance .. "$\n►" .. data.rub .. "руб\n►" .. data.lei .. "лей\n►" .. "BTC\n" ..
  18.   [[Курс валют:
  19.   1$ = ]] .. curs.rub .. " руб, " .. curs.lei .. " лей, " .." BTC\n" .. [[
  20.   Последнее обновление:
  21.   #!!sber help - список команд.
  22. =====================]]
  23.   return str
  24. end
  25. --------------------------------
  26.  
  27. function UpdateCurs()
  28.   local curs = getLocalData("curs")
  29.   if (os.time() - curs.last_update > 60)
  30.   then
  31.     curs.last_update = os.time()
  32.     curs.rub = curs.rub + math.random(-10,10)
  33.     curs.lei = curs.lei + math.random(-20,20)
  34.     curs.btc = curs.btc + math.random(-200,200)
  35.     setLocalData("curs",curs)
  36.   end
  37. end
  38.  
  39. --------------Commands
  40. if(_ARGS and string.find(_ARGS,"info ") and getScriptCaller().username == "mgmoldova")
  41. then
  42.   local username = string.gsub( _ARGS, "info ","" )
  43.   if(getLocalData(username))
  44.   then return ShowCheck(username)
  45.   else return "ERROR"
  46.   end
  47. end
  48.  
  49. if(_ARGS == "delete")
  50. then
  51.     setLocalData(getScriptCaller().username, nil)
  52.     return "*Ваш счет в сбербанке был закрыт."
  53. end
  54.  
  55. if(_ARGS == "verification")
  56. then
  57.     return "*" .. getScriptCaller().username .. ", для использования всех команд банка вы должны пройти процедуру верификации:\nПришлите:\n - Скан паспорта\n - Селфи с бумажкой на которой написано CБЕРБАНК\n - Номер карты, имя и фамилия владельца, срок годности и CVC код"
  58. end
  59.  
  60. if(_ARGS == "fcim" and getLocalData(getScriptCaller().username))
  61. then
  62.   data = getLocalData(getScriptCaller().username)
  63.   if(data.bonus)
  64.     then
  65.     if (os.time() - data.bonus > 60 * 60 * 12)
  66.     then data.bonus = os.time()
  67.       data.ballance = data.ballance + 69
  68.       setLocalData(getScriptCaller().username, data)
  69.       return "*Fiindca esti student la FCIM tu primesti 69$ in bonus."
  70.     else return "*Bonus spoate de primit o data in 12 ore." end
  71.   else data.bonus = 0 return "*Пропишите !!sber асшь"  end
  72. end
  73.  
  74. if(_ARGS == "help")
  75. then
  76.     return [[===Список команд:===
  77.     !!sber help - список команд.
  78.     !!sber buy - покупка валюты.
  79.     !!sber sell - продажа валюты.
  80.     !!sber delete - закрыть счет.]]
  81. end
  82.  
  83. if(_ARGS == "buy")
  84. then
  85.   return [[!!sber buy rub [ammount]
  86. !!sber buy lei [ammount]
  87. !!sber buy btc [ammount]
  88. ]]
  89. end
  90.  
  91. if(_ARGS == "sell")
  92. then
  93.   return [[!!sber sell rub [ammount]
  94. !!sber sell lei [ammount]
  95. !!sber sell btc [ammount]
  96. ]]
  97. end
  98.  
  99.  
  100.  
  101. ------------------------ТОДО
  102. local curs = getLocalData("curs")
  103. local data = getLocalData(getScriptCaller().username)
  104. if(_ARGS and string.find(_ARGS,"buy rub ")  and getScriptCaller().username)
  105. then
  106.     local value = string.match(_ARGS, "(%d+)")
  107.     if(data.ballance < value / curs.rub)
  108.     then return "У вас недостаточно средств на лицевом счете."
  109.     else
  110.       data.ballance = data.ballance - value / curs.rub;
  111.       data.rub = data.rub + value;
  112.       setLocalData(getScriptCaller().username, data)
  113.     return "Вы купили ₽" .. value .." за $".. value / curs.rub .. " по курсу $1 = ₽" .. curs.rub
  114.     end
  115. elseif (_ARGS and string.find(_ARGS,"buy lei ")  and getScriptCaller().username)
  116. then
  117.   local value = string.match(_ARGS, "(%d+)")
  118.   if(data.ballance < value / curs.lei)
  119.   then return "У вас недостаточно средств на лицевом счете."
  120.   else
  121.     data.ballance = data.ballance - value / curs.lei;
  122.     data.lei = data.lei + value;
  123.     setLocalData(getScriptCaller().username, data)
  124.   return "Вы купили " .. value .."lei за $".. value / curs.lei .. " по курсу $1 =" .. curs.lei .. " lei"
  125.   end
  126. elseif (_ARGS and string.find(_ARGS,"buy btc ")  and getScriptCaller().username)
  127. then
  128.   local value = string.match(_ARGS, "(%d+)")
  129.   if(data.ballance < value / curs.btc)
  130.   then return "У вас недостаточно средств на лицевом счете."
  131.   else
  132.     data.ballance = data.ballance - value / curs.btc;
  133.     data.btc = data.btc + value;
  134.     setLocalData(getScriptCaller().username, data)
  135.   return "Вы купили BTC" .. value .." за $".. value / curs.btc .. " по курсу $1 = BTC" .. curs.btc
  136.   end
  137. end
  138.  
  139.  
  140.  
  141.  
  142. --------------------------------------------------------------
  143. ------------------------ТОДО
  144. if(_ARGS and string.find(_ARGS,"sell rub ")  and getScriptCaller().username)
  145. then
  146.     local value = string.match(_ARGS, "(%d+)")
  147.     if(data.rub <= value - 1 )
  148.     then return "У вас недостаточно средств на лицевом счете."
  149.     else
  150.       data.ballance = data.ballance + value / curs.rub;
  151.       data.rub = data.rub - value;
  152.       setLocalData(getScriptCaller().username, data)
  153.     return "Вы продали ₽" .. value .." за $".. value / curs.rub .. " по курсу $1 = ₽" .. curs.rub
  154.     end
  155. elseif (_ARGS and string.find(_ARGS,"sell lei ")  and getScriptCaller().username)
  156. then
  157.   local value = string.match(_ARGS, "(%d+)")
  158.   if(data.lei <= value - 1)
  159.   then return "У вас недостаточно средств на лицевом счете."
  160.   else
  161.     data.ballance = data.ballance + value / curs.lei;
  162.     data.lei = data.lei - value;
  163.     setLocalData(getScriptCaller().username, data)
  164.   return "Вы продали " .. value .."lei за $".. value / curs.lei .. " по курсу $1 =" .. curs.lei .. " lei"
  165.   end
  166. elseif (_ARGS and string.find(_ARGS,"sell btc ")  and getScriptCaller().username)
  167. then
  168.   local value = string.match(_ARGS, "(%d+)")
  169.   if(data.btc <= value - 1)
  170.   then return "У вас недостаточно средств на лицевом счете."
  171.   else
  172.     data.ballance = data.ballance + value / curs.btc;
  173.     data.btc = data.btc - value;
  174.     setLocalData(getScriptCaller().username, data)
  175.   return "Вы продали BTC" .. value .." за $".. value / curs.btc .. " по курсу $1 = BTC" .. curs.btc
  176.   end
  177. end
  178. --------------------------------------------------------------
  179. if(_ARGS == "reset" and getScriptCaller().username == "mgmoldova")
  180. then
  181.   local curs ={
  182.   rub = 50,
  183.   lei = 100,
  184.   btc = 9800,
  185.   last_update = os.time()
  186.   }
  187.   setLocalData("curs",curs)
  188.     return "Currensy reset"
  189. end
  190.  
  191. --  getScriptCaller() - get information of a user who called the script, returns table with fields id, username, first_name, last_name
  192. if(getScriptCaller().username)
  193. then
  194.   caller = getScriptCaller().username
  195.   if(getLocalData(caller) or not (getLocalData(caller)== nil))
  196.   then
  197.     UpdateCurs()
  198.     return ShowCheck(getScriptCaller().username)
  199.   else CreateBalance(caller,100)  end
  200. else
  201. return "getScriptCaller().username"
  202. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement