Advertisement
Guest User

Untitled

a guest
Mar 20th, 2023
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 8.62 KB | None | 0 0
  1. DPIMultiplier=getScreenDPI()/96
  2.  
  3. num=7
  4.  
  5. if srcfrm1 then srcfrm1.Destroy() srcfrm1=nil end
  6. srcfrm1=createForm()
  7. srcfrm1.height=355*DPIMultiplier srcfrm1.width=320*DPIMultiplier srcfrm1.left=424*DPIMultiplier srcfrm1.top=172*DPIMultiplier
  8. srcfrm1.PopupMode=0 srcfrm1.caption="CE Forum: View User Posts!"
  9. srcfrm1.Position="poDesktopCenter" srcfrm1.BorderStyle=1
  10. srcfrm1.Font.Style="" srcfrm1.Font.Size=12
  11. -------------------------
  12. local srcTbl = {}
  13. ----------------------- srcTbl.lbl1 -----
  14. srcTbl.lbl1=createLabel(srcfrm1)
  15. srcTbl.lbl1.AutoSize=true
  16. srcTbl.lbl1.height=19*DPIMultiplier srcTbl.lbl1.width=86*DPIMultiplier srcTbl.lbl1.left=16*DPIMultiplier srcTbl.lbl1.top=15*DPIMultiplier
  17. srcTbl.lbl1.caption="User  Name: "
  18. srcTbl.lbl1.alignment="taLeftJustify"
  19. -----------------------
  20. ----------------------- srcTbl.edt1 -----
  21. srcTbl.edt1=createComboBox(srcfrm1)
  22. srcTbl.edt1.AutoSize=false
  23. srcTbl.edt1.height=22*DPIMultiplier srcTbl.edt1.width=192*DPIMultiplier srcTbl.edt1.left=109*DPIMultiplier srcTbl.edt1.top=15*DPIMultiplier
  24. srcTbl.edt1.ReadOnly=false srcTbl.edt1.Style="csDropDown" srcTbl.edt1.Font.Size=9
  25. -----------------------
  26. ----------------------- srcTbl.btn1 -----
  27. srcTbl.btn1=createButton(srcfrm1)
  28. srcTbl.btn1.AutoSize=false
  29. srcTbl.btn1.height=25*DPIMultiplier srcTbl.btn1.width=300*DPIMultiplier srcTbl.btn1.left=10*DPIMultiplier srcTbl.btn1.top=50*DPIMultiplier
  30. srcTbl.btn1.caption="Open  the   search   result  in  Browser!"
  31. -----------------------
  32. ----------------------- srcTbl.lbl2 -----
  33. srcTbl.lbl2=createLabel(srcfrm1)
  34. srcTbl.lbl2.AutoSize=false
  35. srcTbl.lbl2.height=24*DPIMultiplier srcTbl.lbl2.width=300*DPIMultiplier srcTbl.lbl2.left=10*DPIMultiplier srcTbl.lbl2.top=87*DPIMultiplier
  36. srcTbl.lbl2.caption="List of available pages:"
  37. srcTbl.lbl2.alignment="taCenter"
  38. srcTbl.lbl2.OptimalFill=true srcTbl.lbl2.Font.Size=11
  39. -----------------------
  40. ----------------------- srcTbl.lbl3 -----
  41. srcTbl.lbl3=createLabel(srcfrm1)
  42. srcTbl.lbl3.AutoSize=false
  43. srcTbl.lbl3.height=24*DPIMultiplier srcTbl.lbl3.width=160*DPIMultiplier srcTbl.lbl3.left=10*DPIMultiplier srcTbl.lbl3.top=122*DPIMultiplier
  44. srcTbl.lbl3.caption="Autor/User:"
  45. srcTbl.lbl3.OptimalFill=true  srcTbl.lbl3.Font.Size=11
  46. -----------------------
  47. ----------------------- srcTbl.Cbx1 -----
  48. srcTbl.Cbx1=createComboBox(srcfrm1)
  49. srcTbl.Cbx1.AutoSize=true
  50. srcTbl.Cbx1.height=27*DPIMultiplier srcTbl.Cbx1.width=130*DPIMultiplier srcTbl.Cbx1.left=180*DPIMultiplier srcTbl.Cbx1.top=120*DPIMultiplier
  51. srcTbl.Cbx1.Font.Size=9 srcTbl.Cbx1.OptimalFill=true
  52. srcTbl.Cbx1.ReadOnly=true srcTbl.Cbx1.Style="csDropDownList"
  53. -----------------------
  54. -----------------------
  55.  
  56. local nextLeft = 10*DPIMultiplier
  57. local nextTop = 5*DPIMultiplier
  58. local pages22= 0
  59. local browser1 = "chrome.exe"
  60. --srcTbl.edt1.text="mgr.inz.Player"
  61. -----------------------
  62.  
  63. function createScrollBox(Parent)
  64. local box = createComponentClass('TScrollBox', Parent)
  65.  box.Parent = Parent
  66.  return box
  67. end
  68.  
  69. function LoadUrl(link)
  70.   local int=getInternet()
  71.   s=int.getURL(link)
  72.   int.destroy()
  73.   return s
  74. end
  75. -----------------------
  76. srcTbl.Scrbx1=createScrollBox(srcfrm1)
  77. srcTbl.Scrbx1.AutoSize=false
  78. srcTbl.Scrbx1.height=180*DPIMultiplier srcTbl.Scrbx1.width=300*DPIMultiplier srcTbl.Scrbx1.left=10*DPIMultiplier srcTbl.Scrbx1.top=160*DPIMultiplier
  79. srcTbl.Scrbx1.Color=10395294 srcTbl.Scrbx1.Font.Style="fsBold" srcTbl.Scrbx1.Font.Size=10
  80. -----------------------
  81.  
  82. function pageClear()
  83. nextTop=5*DPIMultiplier
  84. nextLeft = 10*DPIMultiplier
  85. srcTbl.Scrbx1.Destroy() srcTbl.Scrbx1=nil
  86. srcTbl.Scrbx1=createScrollBox(srcfrm1)
  87. srcTbl.Scrbx1.AutoSize=false
  88. srcTbl.Scrbx1.height=180*DPIMultiplier srcTbl.Scrbx1.width=300*DPIMultiplier srcTbl.Scrbx1.left=10*DPIMultiplier srcTbl.Scrbx1.top=160*DPIMultiplier
  89. srcTbl.Scrbx1.Color=10395294 srcTbl.Scrbx1.Font.Style="fsBold" srcTbl.Scrbx1.Font.Size=10
  90. end
  91. -----------------------
  92. srcTbl.edt1.Clear()
  93. srcTbl.edt1.Items.Add("") -- Search edit ..
  94. srcTbl.edt1.Items.Add("Dark Byte") --443
  95. srcTbl.edt1.Items.Add("mgr.inz.Player") --212
  96. srcTbl.edt1.Items.Add("atom0s") --191
  97. srcTbl.edt1.Items.Add("Recifense") --163
  98. srcTbl.edt1.Items.Add("Zanzer") --126
  99. srcTbl.edt1.Items.Add("ParkourPenguin") --119
  100. srcTbl.edt1.Items.Add("++METHOS") --81
  101. srcTbl.edt1.ItemIndex=0
  102. ------------------------
  103. ------------------------
  104. srcTbl.Cbx1.Clear()
  105. srcTbl.Cbx1.Items.Add("Select Browser")
  106. srcTbl.Cbx1.Items.Add("Google Chrome")
  107. srcTbl.Cbx1.Items.Add("Mozilla Firefox")
  108. srcTbl.Cbx1.Items.Add("Microsoft Edge")
  109. srcTbl.Cbx1.Items.Add("Opera")
  110. srcTbl.Cbx1.Items.Add("Internet Explorer")
  111. srcTbl.Cbx1.Items.Add("Maxthon")
  112. srcTbl.Cbx1.Items.Add("Pale Moon")
  113. srcTbl.Cbx1.ItemIndex=0
  114.  
  115. srcTbl.Cbx1.OnChange=function()
  116. local indd1=srcTbl.Cbx1.ItemIndex
  117. if indd1==0 then browser1 = "chrome.exe" end --default
  118. if indd1==1 then browser1 = "chrome.exe" end
  119. if indd1==2 then browser1 = "firefox.exe" end
  120. if indd1==3 then browser1 = "msedge.exe" end
  121. if indd1==4 then browser1 = "opera.exe" end
  122. if indd1==5 then browser1 = "iexplore.exe" end
  123. if indd1==6 then browser1 = "Maxthon.exe" end
  124. if indd1==7 then browser1 = "palemoon.exe" end
  125. end
  126.  
  127. function crtLabel(cpt,idx,idx2,ops)
  128. titleLbl=createLabel(srcTbl.Scrbx1)
  129.  if nextLeft==270*DPIMultiplier then nextLeft=10*DPIMultiplier nextTop=tonumber(nextTop) + 20*DPIMultiplier end
  130. titleLbl.Left=tonumber(nextLeft)
  131. nextLeft = tonumber(nextLeft) + 65*DPIMultiplier
  132.  --print(nextLeft)
  133. titleLbl.Top=nextTop
  134. titleLbl.Caption="Page #"..idx
  135. titleLbl.Font.Size=10
  136. titleLbl.height=20*DPIMultiplier
  137. titleLbl.width=660*DPIMultiplier
  138. titleLbl.Tag=650
  139.  
  140.  if ops==3 then
  141.  titleLbl.AutoSize=false
  142.  titleLbl.width=280*DPIMultiplier
  143.  titleLbl.alignment=2*DPIMultiplier
  144.  titleLbl.Caption=cpt
  145.  titleLbl.height=24*DPIMultiplier
  146.  titleLbl.Top=5*DPIMultiplier
  147.  titleLbl.OptimalFill=true
  148.  nextTop=40*DPIMultiplier
  149.  pages22=0
  150.  end
  151.  if ops==1 then
  152.   titleLbl.Font.Color=16711680
  153.   titleLbl.Font.Style="fsBold,fsUnderline"
  154.   titleLbl.Cursor = -21
  155.   name1=srcTbl.edt1.Text
  156.   titleLbl.OnClick=function()
  157.   lnk="https://forum.cheatengine.org/search.php?search_author="..name1.."&start="..idx2
  158.    shellExecute(browser1,lnk) end
  159.  end
  160.  if ops==2 then
  161.   titleLbl.Font.Color=16711680
  162.   titleLbl.Font.Style="fsBold,fsUnderline"
  163.   titleLbl.Cursor = -21
  164.   name1=srcTbl.edt1.Text
  165.   titleLbl.OnClick=function()
  166.   lnk="https://forum.cheatengine.org/search.php?search_author="..name1.."&start="..idx2
  167.    shellExecute(browser1,lnk) end
  168.  end
  169. end
  170.  
  171. function urlFormats(str)
  172.    str = string.gsub (str, "([^0-9a-zA-Z !'()*._~-])", -- locale independent
  173.       function (c) return string.format ("%%%02X", string.byte(c)) end)
  174.    str = string.gsub (str, " ", "+")
  175.    return str
  176. end
  177.  
  178. function search()
  179. pgIdx = 0
  180. pfind1 = 0
  181. pfind2 = 0
  182.  if srcTbl.edt1.Text=="" then
  183.   showMessage("Type a username in the box and try again!")
  184.  else
  185.   url1 = LoadUrl("https://forum.cheatengine.org/search.php?search_author="..urlFormats(srcTbl.edt1.Text).."&start="..pages22)
  186.    if url1 then
  187.     url2 = (url1):gsub("&","&")
  188.     sl1=createStringList()
  189.     sl1.Text=url1
  190.      cnt1 = strings_getCount(sl1)-1
  191.      for i=0, strings_getCount(sl1)-1 do
  192.  
  193.       art1=(sl1[i]):gsub("  ", ""):gsub("   ", ""):gsub("    ", ""):gsub("     ", ""):gsub("               ", "")
  194.       art22 = (art1):match([[class="maintitle">(.*)</span><br]])
  195.         if art22~=nil then
  196.          srcTbl.lbl2.caption=art22
  197.          pfind2 = tonumber((art22):match([[found (.*) matches]]))
  198.         end
  199.         art23,art24 = (art1):match([[class="name"><b><a href="(.*)">(.*)</a></b></span><br />]])
  200.         if art23~=nil then
  201.          srcTbl.lbl3.caption="Visit Profile:  "..art24
  202.          srcTbl.lbl3.Font.Color=16711680
  203.          srcTbl.lbl3.Font.Style="fsBold,fsUnderline"
  204.          srcTbl.lbl3.Cursor = -21
  205.          lnk11=(art23):gsub("amp;","")
  206.           --print(art23.." - "..art24)
  207.           srcTbl.lbl3.OnClick=function()
  208.            shellExecute(browser1,[[https://forum.cheatengine.org/]]..lnk11)
  209.           end
  210.         end
  211.  
  212.         art2 = (art1):match([[nav">(.*)</b></span]]) --sub(1,17)
  213.        --print(art2)
  214.       if art2~=nil then
  215.        pfind = (art2):gsub([[<b>]],""):gsub([[</b>]],"")
  216.        pfind1 = tonumber((pfind):match([[of (.*)]]))
  217.        crtLabel(pfind,0,0,3)
  218.       end
  219.     end
  220.  
  221.     sl1.Destroy()
  222.     nextLeft = 10*DPIMultiplier
  223.     pages22=0
  224.      for i=1, tonumber(pfind1) do
  225.       if i==tonumber(pfind1) then
  226.        pf2 = math.floor(tonumber(pfind2) / 15)
  227.        pages22=pf2*15
  228.        crtLabel("Pages",i,pages22-15,1)
  229.       else
  230.        crtLabel("Pages",i,pages22,2)
  231.        pages22=i * 15
  232.       end
  233.      end
  234.   end
  235. end
  236. end
  237.  
  238. srcTbl.btn1.OnClick=function()
  239. pageClear()
  240. pages22 = 0
  241. search()
  242. end
  243.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement