Jump to content

ChatGPT is able to scripting! No Joke!


Rynbef

Recommended Posts


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

Yes, I'm not joking. Chatgpt is able to scripting. Of course it's not rly the complex one but it works.

Screenshot_20230306_023600_Chrome.thumb.jpg.137347c5002d63be839cb43e40eb03cc.jpg

Screenshot_20230306_023616_Chrome.thumb.jpg.16b52db0855cf000d468a7394fd20ec4.jpg

 

Here is the code:

prontera,140,140,4	script	Healer	4_F_HILDA,{
    if (getgmlevel() >= 1) { // nur für GMs verfügbar
        mes "[Healer]";
        mes "Hallo, wie kann ich dir helfen?";
        next;
        if (select("Ich möchte geheilt werden.") == 1) {
            mes "[Healer]";
            mes "Klar, ich werde dich heilen!";
            heal 100,100; // HP und SP heilen
            close2;
        }
    } else {
        mes "[Healer]";
        mes "Es tut mir leid, ich kann dir nicht helfen.";
        close2;
    }
}

OnInit:
    setarray .mobid, 383; // Sprite-ID des Healers
    setarray .mobx, 140; // X-Koordinate des Healers
    setarray .moby, 140; // Y-Koordinate des Healers
    setarray .mobs, 4; // Richtung des Healers
    setarray .mobby, 0; // Mobspawn-Optionen
    spawnnpc .mobid[rand(0, getarraysize(.mobid)-1)], .mobx[rand(0, getarraysize(.mobx)-1)], .moby[rand(0, getarraysize(.moby)-1)], .mobs[rand(0, getarraysize(.mobs)-1)], "", .mobby[rand(0, getarraysize(.mobby)-1)], 0, 0, 0, 0;
    end;

 

Rynbef~

Link to comment
Share on other sites


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

Notice: if u don't think this is real cuz of my mistake "prontira" or 383 and he replace it with 4_F_HILDA. try it by your self. Please give them as much details as possible. After this I could say "remove the min group level" etc and he will do it.

 

Rynbef~

Link to comment
Share on other sites


  • Group:  Forum Manager
  • Topic Count:  282
  • Topics Per Day:  0.06
  • Content Count:  3123
  • Reputation:   1617
  • Joined:  03/26/12
  • Last Seen:  

spawnnpc isn't a script command.

No reason at all to create arrays for variables, and all those extra getarraysize commands..

Short answer: no, it cant. Don't be lazy.

Link to comment
Share on other sites


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

I know it but u can tell it and he fix it. For story line quests or translations it works perfectly.

 

Rynbef~

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

Ehh this is what I got when I asked awhile ago. In other word garbage because of the email filter.

- script Item Exchange -1,{
    // Item IDs and exchange rates
    setarray .itemList,501,502,503,504;
    setarray .exchangeRates,10,20,30,40;
    // Reward IDs and amounts
    setarray .rewardList,1001,1002,1003,1004;
    setarray .rewardAmounts,1,2,3,4;
    
    mes "Hello there! I am the Item Exchange NPC.";
    mes "I can exchange certain items for rewards.";
    next;
    mes "Here is the list of items that I accept:";
    for (set [email protected],0; [email protected] < getarraysize(.itemList); set [email protected],[email protected]+1) {
        mes "- " + getitemname(.itemList[[email protected]]) + " x " + .exchangeRates[[email protected]];
    }
    next;
    mes "What would you like to exchange today?";
    [email protected] = select("Exchange an item for a reward","I'll come back later");
    if ([email protected] == 2) {
        close;
    }
    mes "Great! Please select the item that you would like to exchange.";
    [email protected] = menu("Please select the item:", getitemname(.itemList));
    if ([email protected] == 0) {
        mes "You don't have any of the required items.";
        close;
    }
    [email protected] -= 1;
    mes "You have selected " + getitemname(.itemList[[email protected]]) + ".";
    mes "How many of these items would you like to exchange?";
    [email protected] = input("Please enter the quantity:");
    if ([email protected] <= 0) {
        mes "You must enter a valid quantity.";
        close;
    }
    if ([email protected] > getitemcount(.itemList[[email protected-1]])) {
        mes "You don't have enough of the selected item.";
        close;
    }
    mes "You have selected to exchange " + [email protected] + " " + getitemname(.itemList[[email protected-1]]) + ".";
    mes "Here is the list of rewards that you can choose from:";
    for (set [email protected],0; [email protected] < getarraysize(.rewardList); set [email protected],[email protected]+1) {
        mes "- " + getitemname(.rewardList[[email protected]]) + " x " + .rewardAmounts[[email protected]];
    }
    next;
    mes "Which reward would you like to receive?";
    [email protected] = menu("Please select your reward:", getitemname(.rewardList));
    if ([email protected] == 0) {
        mes "You must select a valid reward.";
        close;
    }
    [email protected] -= 1;
    mes "You have selected " + getitemname(.rewardList[[email protected]]) + ".";
    mes "Here is your reward:";
    getitem .rewardList[[email protected]], .rewardAmounts[[email protected]];
    delitem .itemList[[email protected]], .exchangeRates[[email protected]] * [email protected];
    close;
}

 

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