uniteragnarok

afkarea.txt

Sep 13th, 2020
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. prontera,157,184,4 script AFKMaster -1,{
  2.  
  3. OnPCLoginEvent:
  4.  
  5. Counterstart:
  6.  
  7. set @countertime,0;
  8. set @onArea,0;
  9. attachnpctimer ""+strcharinfo(0)+"";
  10. initnpctimer;
  11.  
  12. end;
  13.  
  14.  
  15. OnTimer1000:
  16.  
  17. //cek pos
  18. getmapxy( @map$, @x, @y );
  19. if(@map$==$map$){
  20. if($X2<@x && $X1>@x){
  21. if($Y2<@y && $Y1>@y){
  22. if(@onArea!=1){
  23. set @onArea,1;
  24. dispbottom "You Are now in AFK Area!";
  25. set @warning,1;
  26. }
  27. }
  28. else{
  29. if(@warning==1){
  30. set @onArea,0;
  31. dispbottom "You Are Leaving AFK Area!";
  32. set @warning,0;
  33. stopnpctimer;
  34. goto Counterstart;
  35. end;
  36. }
  37. }
  38. }
  39. }
  40.  
  41. if(@map$==$map$){
  42. if($Y2<@y && $Y1>@y){
  43. if($X2<@x && $X1>@x){
  44. if(@onArea!=1){
  45. set @onArea,1;
  46. dispbottom "You Are now in AFK Area!";
  47. set @warning,1;
  48. }
  49. }
  50. else{
  51. if(@warning==1){
  52. set @onArea,0;
  53. dispbottom "You Are Leaving AFK Area!";
  54. set @warning,0;
  55. stopnpctimer;
  56. goto Counterstart;
  57. end;
  58. }
  59. }
  60. }
  61. }
  62.  
  63. //cek time & reset + set prize
  64. set @countertime,@countertime+1;
  65. if(@countertime==($AFKTime*5)){
  66. if(@onArea==1){
  67. getitem 678,1;
  68. dispbottom "You get AFK Point for stay in AFK AREA!";
  69. stopnpctimer;
  70. goto Counterstart;
  71. }else{
  72. dispbottom "You miss AFK Point Because not in AFK AREA!";
  73. stopnpctimer;
  74. goto Counterstart;
  75. }
  76. }
  77.  
  78. stopnpctimer;
  79. initnpctimer;
  80.  
  81. end;
  82.  
  83. OnInit:
  84.  
  85. set $AFKTime,1;
  86. set $map$,"prontera";
  87. set $X1,152;
  88. set $Y1,145;
  89. set $X2,159;
  90. set $Y2,178;
  91.  
  92.  
  93. end;
  94.  
  95. }
  96.  
  97.  
  98.  
Add Comment
Please, Sign In to add comment