Jump to content

Script with chat gpt


V1N1C1U5

Recommended Posts


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  2
  • Reputation:   0
  • Joined:  04/12/13
  • Last Seen:  

I ask to chat gpt to make an npc to heal and give buff to near players, this is the result:

#include <stdio.h>
#include <unistd.h>

// Função para obter jogadores próximos
Player* get_nearby_players(int* num_players) {
  // Código para obter jogadores próximos
  return players;
}

// Função para curar jogadores
void heal_players(Player* players, int num_players) {
  for (int i = 0; i < num_players; i++) {
    // Código para curar o jogador
    players[i].health = players[i].max_health;
  }
}

// Função para dar buff nos jogadores
void buff_players(Player* players, int num_players) {
  for (int i = 0; i < num_players; i++) {
    // Código para adicionar um buff ao jogador
    players[i].buffs |= BUFF_ID;
  }
}

int main() {
  while (1) {
    int num_players;
    // Obter jogadores próximos
    Player* players = get_nearby_players(&num_players);
    
    // Curar jogadores
    heal_players(players, num_players);
    
    // Dar buff nos jogadores
    buff_players(players, num_players);
    
    // Pausar por alguns segundos antes de executar novamente
    sleep(5);
  }
  
  return 0;
}

Now my question to u guys, this gonna work in emulator?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  20
  • Reputation:   1
  • Joined:  09/04/17
  • Last Seen:  

If you mean an "rAthena NPC script"

I guess this won't work.

The code you've shown above only seems like some C style code rather than rAthena script.

  • Upvote 1
Link to comment
Share on other sites

  • 2 months later...

  • Group:  Forum Moderator
  • Topic Count:  44
  • Topics Per Day:  0.01
  • Content Count:  862
  • Reputation:   115
  • Joined:  05/23/12
  • Last Seen:  

Its rly possible. I've tested it yesterday with a simple script.

 

Rynbef~

 

 

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
Reply to this topic...

×   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...