Jump to content
  • 0

AFK in Spesific Area Get Reward


deceel

Question


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  21
  • Reputation:   0
  • Joined:  03/11/13
  • Last Seen:  

core,152,142,4    script    AFKMaster    -1,{

OnPCLoginEvent:
if (#AFK_resets != $AFK_resets){
    set #AFKpoint,0;
        set #AFK_resets,$AFK_resets;
    }
    

if($AFK_resets==0){
    
    if(getgmlevel()>90){
        set $AFK_resets,1;
        mes "[AFKMaster]";
        mes "This will set your first AFK setting.";
        mes "You can change it again on NPC AFK Setting.";
        next;
        mes "[AFKMaster]";
        mes "OK now set the area";
        mes "============X1,Y1";
        mes "*****************";
        mes "*****************";
        mes "X2,Y2============";
        next;
        mes "[AFKMaster]";
        mes "Input map.";
        input $map$;
        mes "AFK Map : "+$map$;
        next;
        mes "[AFKMaster]";
        mes "Input X1";
        input $X1;
        mes "X1 : "+$X1;
        next;
        mes "[AFKMaster]";
        mes "Input Y1";
        input $Y1;
        mes "Y1 : "+$Y1;
        next;
        mes "[AFKMaster]";
        mes "Input X2";
        input $X2;
        mes "X1 : "+$X2;
        next;
        mes "[AFKMaster]";
        mes "Input Y2";
        input $Y2;
        mes "Y2 : "+$Y2;
        next;
        mes "[AFKMaster]";
        mes "The area setting :";
        mes "AFK Map : "+$map$;
        mes "============"+$X1+","+$Y1;
        mes "*****************";
        mes "*****************";
        mes $X2+","+$Y2+"==========";
        next;
        mes "[AFKMaster]";
        mes "The area setting is ready";
        mes "You can change it again on NPC AFK Setting.";
        close;
        }

    }    

Counterstart:

set @countertime,0;
set @onArea,0;
attachnpctimer ""+strcharinfo(0)+"";
initnpctimer;

end;


OnTimer1000:

//cek pos
getmapxy( @map$, @x, @y, BL_PC );
if(@map$==$map$){
    if($X2<@x && $X1>@x){
        if($Y2<@y && $Y1>@y){
            if(@onArea!=1){
                set @onArea,1;
                dispbottom "Nice!! You are now in AFK Area";
                set @warning,1;
            }
        }
        else{
            if(@warning==1){
                set @onArea,0;
                dispbottom "WAIT WAIT!! You are leaving AFK Area";
                set @warning,0;
            }
        }
    }
}

//cek time & reset + set prize
set @countertime,@countertime+1;
if(@countertime==($AFKTime*60)){
    if(@onArea==1){
        getitem 25004,1;
        dispbottom "Thank you for always stay near me";
        stopnpctimer;
        goto Counterstart;
    }else{
        dispbottom "Sorry,you missed AFK Coin because you're not in AFK AREA";
        stopnpctimer;
        goto Counterstart;
    }
}

stopnpctimer;
initnpctimer;

end;

OnInit:
set $AFKTime,30;

end;    

}


core,150,145,4    script    AFK Area    835,{
    
    if(getgmlevel()>90){
        mes "[AFKSetting]";
        mes "This is NPC for channge AFK AREA SETTING";
        mes "By default AFK time is 30 minute.";
        mes "You can change it by minute.";
        next;
        mes "Select Setting you wish to change";
        switch(select("AFK Time",
                "Map and Coordinat",
                "Quit"
        )){;
        case 1:
                next;
                mes "[AFKSetting]";
                mes "Last AFK time : "+$AFKTime+" minute";
                mes "Input new AFK time";
                input $AFKTime;
                next;
                mes "[AFKSetting]";
                mes "You have change AFK time to : "+$AFKTime+" minute";
                close;
                
            break;
            
        case 2:
                next;
                mes "[AFKSetting]";
                mes "This will change your AFK setting.";
                next;
                mes "[AFKSetting]";
                mes "The last area setting :";
                mes "AFK Map : "+$map$;
                mes "============"+$X1+","+$Y1;
                mes "*****************";
                mes "*****************";
                mes $X2+","+$Y2+"==========";
                next;
                mes "[AFKSetting]";
                mes "OK now set the new area";
                mes "============X1,Y1";
                mes "*****************";
                mes "*****************";
                mes "X2,Y2============";
                next;
                mes "[AFKSetting]";
                mes "Input map.";
                input $map$;
                mes "AFK Map : "+$map$;
                next;
                mes "[AFKSetting]";
                mes "Input X1";
                input $X1;
                mes "X1 : "+$X1;
                next;
                mes "[AFKSetting]";
                mes "Input Y1";
                input $Y1;
                mes "Y1 : "+$Y1;
                next;
                mes "[AFKSetting]";
                mes "Input X2";
                input $X2;
                mes "X1 : "+$X2;
                next;
                mes "[AFKSetting]";
                mes "Input Y2";
                input $Y2;
                mes "Y2 : "+$Y2;
                next;
                mes "[AFKSetting]";
                mes "The area setting :";
                mes "AFK Map : "+$map$;
                mes "============"+$X1+","+$Y1;
                mes "*****************";
                mes "*****************";
                mes $X2+","+$Y2+"==========";
                
                close;
                                
            break;
            
            case 3:
                next;
                mes "[AFKSetting]";
                mes "The area setting not change";
                mes "You can change it again anytime.";
                close;
                
        }
    }    
    

    
    
}

 

My Script give some problem to my other npc.. my other npc closed automaticaly.. How come?Whats wrong with my script? But this AFK NPc works perfectly.. If i turn off this NPC, my other npc works perfectly.. Help me

Edited by deceel
codebox
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

We're not so genius to guess how your other script is doing. Maybe you could post both scripts which you think conflicts each other so other people could help you solve your issues.

  • MVP 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  21
  • Reputation:   0
  • Joined:  03/11/13
  • Last Seen:  

@Patskie thx for reply.. all my npc get same problem if i put my AFK script

@Emistry can you help me bro?

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  107
  • Topics Per Day:  0.02
  • Content Count:  770
  • Reputation:   69
  • Joined:  02/10/12
  • Last Seen:  

6 hours ago, deceel said:

@Patskie thx for reply.. all my npc get same problem if i put my AFK script

@Emistry can you help me bro?

 

so telling us whats its your problem or any error in console?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...