Quote: |
case EVENT_Tick:
{ for (int i = 0; i < 4; ++i) --countdown[i]; Player *p = (Player*)event.p[0]; turrpoint1=0; _listnode <Player> *parse2 = playerlist->head; while(parse) { Player *p = parse2->item; if(level == 0) { if(p->tile.x >= 89 && p->tile.x <= 91 && p->tile.y >= 18 && p->tile.y <= 20) { turpoint1++; } } parse2 = parse->next; } Then later: case EVENT_PlayerMove: { Player *p = (Player*)event.p[0]; if(p->tile.x >= 502 && p->tile.x <= 503 && p->tile.y >= 512 && p->tile.y <= 513) { if(level == 0 && turpoint1 == 0) { sendPrivate(p, "*warpto 90 19"); sendPrivate(p, "You are warped to turretpoint 1."); } } if(p->tile.x >= 502 && p->tile.x <= 503 && p->tile.y >= 512 && p->tile.y <= 513) { if(level == 0 && turpoint1 != 0) { sendPrivate(p, "*warpto 90 24"); sendPrivate(p, "Turrentpoint occupied, alternative warping.."); } |
Solo Ace wrote: |
I think you should learn how to debug your plugins for MERVbot.
Not sure if you have MS VC++, but this is how you debug your MERV plugins:
After doing this you can see values of variables (by adding a watch or by just hovering over it with your mouse), and you can step through the code using F10 (step over) and F11 (step into). By doing this you can see which, how and when the code is being executed. This information may not be useful to you, but maybe someone else can use it. |
Code: Show/Hide case EVENT_Tick:
{ for (int i = 0; i < 4; ++i) --countdown[i]; Player *p = (Player*)event.p[0]; turrpoint1=0; _listnode <Player> *parse2 = playerlist->head; while(parse) { Player *p = parse2->item; if(level == 0) { if(p->tile.x >= 89 && p->tile.x <= 91 && p->tile.y >= 18 && p->tile.y <= 20) { turpoint1++; } } parse2 = parse->next; } Then later: case EVENT_PlayerMove: { Player *p = (Player*)event.p[0]; if(p->tile.x >= 502 && p->tile.x <= 503 && p->tile.y >= 512 && p->tile.y <= 513) { if(level == 0 && turpoint1 == 0) { sendPrivate(p, "*warpto 90 19"); sendPrivate(p, "You are warped to turretpoint 1."); } } if(p->tile.x >= 502 && p->tile.x <= 503 && p->tile.y >= 512 && p->tile.y <= 513) { if(level == 0 && turpoint1 != 0) { sendPrivate(p, "*warpto 90 24"); sendPrivate(p, "Turrentpoint occupied, alternative warping.."); } |
Code: Show/Hide #define LIMIT(value, left, right) \
(value >= left && value <= left) |