Advertisement
CivReborn

Auto Object Script

Nov 24th, 2017
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;Auto Object Script
  2. ;By Hellbent aka CivReborn https://www.youtube.com/user/CivReborn
  3. ;Written Nov 24th,2017
  4. #SingleInstance,Force
  5. CoordMode,Mouse,Screen
  6. Global Key_Input,Auto_Key_Amount:=5
  7. Gui,1:+AlwaysOnTop +LastFound
  8. Gui,1:Color,Teal,Black
  9. Gui,1:Font,cBlack s8 Bold Q5,Segoe UI
  10. Gui,1:Add,Edit,cBlack x10 y10 w800 r3 ReadOnly vOutput_Edit ,% Output_String
  11. Gui,1:Add,Groupbox,x10 y+5 w800 h100 Section ,Settings / ETC
  12. Gui,1:Add,ListBox,cWhite xs+10 ys+25 w120 r4 AltSubmit vOutType gDisplay_Output,Object||Object w/Strings|Array|Array w/Strings|Pipe List
  13. Gui,1:Add,Text,cLime x+10 ys+25 w30 ,Name:
  14. Gui,1:Add,Edit,cWhite x+10 yp-2 w100 r1 vName gDisplay_Output,
  15. Gui,1:Add,CheckBox,xs+140 y+20 vALT_Delimiter gDisplay_Output,| Delimiter
  16. Gui,1:Add,Groupbox,xs+300 ys+10 w125 h80 Section
  17. Gui,1:Add,CheckBox,xs+10 ys+20 vAuto_Keys gDisplay_Output,Auto Keys
  18. Gui,1:Add,Text,cLime xs+10 y+15,Amount:
  19. Gui,1:Add,Edit,cRed x+10 yp-2 w50 r1 vAuto_Key_Amount gDisplay_Output,% Auto_Key_Amount
  20. Gui,1:Add,CheckBox,x+30 ys+10 vTimer gTurn_On_Off_Timer,Turn On Transparency
  21. Gui,1:Add,Button,xs+390 ys+60 w100 r1 -Theme gClip_All,Clipboard
  22. Gui,1:Add,GroupBox,x10 y+15 w800 h80 Section ,Input
  23. Gui,1:Add,Text,cLime xs+10 ys+20 w35 ,Keys:
  24. Gui,1:Add,Edit,cWhite x+10 ys+18 w740 r1 vKey_Input gDisplay_Output
  25. Gui,1:Add,Text,cLime xs+10 y+10 w35 ,Value:
  26. Gui,1:Add,Edit,cWhite x+10 yp-2 w740 r1 vValue_Input gDisplay_Output
  27. Gui,1:Submit,NoHide
  28. Gui,1:Show,x540 y0 w820 h265, Auto Object 1
  29. return
  30. Turn_On_Off_Timer:
  31.     Timer:=!Timer
  32.     if(Timer)
  33.         SetTimer,I_Want_To_See,100
  34.     else    {
  35.         SetTimer,I_Want_To_See,-1
  36.     }
  37.     return
  38. I_Want_To_See:
  39.     mouseGetPos,x1,y1
  40.     WinGetPos,x2,y2,w2,h2,Auto Object 1
  41.     if(x1>=x2&&x1<=x2+w2&&y1>=y2&&y1<=y2+h2)
  42.         Winset,Transparent,255,Auto Object 1
  43.     else
  44.         winset,Transparent,20,Auto Object 1
  45.     return
  46. GuiClose:
  47. GuiEscape:
  48.     ExitApp
  49. Display_Output:
  50.     Gui,1:Submit,NoHide
  51.     GuiControl,1:Enable,Key_Input
  52.     (ALT_Delimiter)?(Delimit:="|"):(Delimit:=" ")
  53.     Quote = `"
  54.     temp_Key:="",temp_Key:=[],temp_Value:="",temp_Value:=[]
  55.     (OutType=1)?(S1:=Name ":= {",S2:=":",S3:=",",S4:=":",S5:="}" Run_Output(S1,S2,S3,S4,S5,"","1","0","0"))
  56.     :(OutType=2)?(S1:=Name ":= {",S2:=":",S3:=",",S4:=":",S5:="}" Run_Output(S1,S2,S3,S4,S5,Quote,"1","0","0"))
  57.     :(OutType=3)?(S1:=Name ":= [",S2:=",",S3:="]",S4:="",S5:="" Run_Output(S1,S2,S3,S4,S5,"","0","1","0"))
  58.     :(OutType=4)?(S1:=Name ":= [",S2:=",",S3:="]",S4:="",S5:="" Run_Output(S1,S2,S3,S4,S5,Quote,"0","1","0"))
  59.     :(OutType=5)?(S1:=Name ":= " Quote,S2:="|",S3:=Quote,S4:="",S5:="" Run_Output(S1,S2,S3,S4,S5,Quote,"0","1","1"))
  60.     return
  61.  
  62. Clip_All:
  63.     sleep,20
  64.     Clipboard:=Output_Edit
  65.     return
  66. GuiContextMenu:
  67.     Gui,1:Minimize
  68.     return
  69. Run_Output(S1,S2,S3,S4,S5,EQ,FULL,DisableIt,Organ){
  70.     global
  71.     Output_Edit:=""
  72.     if(DisableIt=1)
  73.         GuiControl,1:Disable,Key_Input
  74.     if(Full=1){
  75.         if(Auto_Keys=0){
  76.             Loop,Parse,Key_Input,% Delimit
  77.                 temp_Key[A_Index]:=A_LoopField
  78.         }else   {
  79.             GuiControl,1:Disable,Key_Input
  80.             Loop,% Auto_Key_Amount
  81.                 temp_Key[A_Index]:= A_Index
  82.         }
  83.     }
  84.     Loop,Parse,Value_Input,% Delimit   
  85.     {
  86.         if(Organ=0)
  87.             temp_Value[A_Index]:=EQ A_LoopField EQ
  88.         else
  89.             temp_Value[A_Index]:= A_LoopField S2
  90.     }
  91.     Output_Edit.= S1
  92.     (temp_Value.MaxIndex()>temp_Key.MaxIndex())?(Loop_Amount:=temp_Value.MaxIndex()):(Loop_Amount:=temp_Key.MaxIndex())
  93.     Loop % Loop_Amount  {
  94.         if(Full=1){
  95.             if(A_Index!=temp_Value.MaxIndex())
  96.                 Output_Edit.=temp_Key[A_Index] S2 temp_Value[A_Index] S3
  97.             else
  98.                 Output_Edit.=temp_Key[A_Index] S4 temp_Value[A_Index] S5
  99.         }else   {
  100.             if(Organ=0){
  101.                 if(A_Index!=temp_Value.MaxIndex())
  102.                     Output_Edit.=temp_Value[A_Index] S2
  103.                 else
  104.                     Output_Edit.= temp_Value[A_Index] S3
  105.             }else   {
  106.                 if(A_Index!=temp_Value.MaxIndex())
  107.                     Output_Edit.=temp_Value[A_Index]
  108.                 else
  109.                     Output_Edit.= temp_Value[A_Index] S3
  110.             }  
  111.         }
  112.     }
  113.     GuiControl,1:,Output_Edit,% Output_Edit
  114. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement