Chatgp is asking for oxygenbasic's o2GUI+ module

Started by Alberto Curiel, July 16, 2023, 04:13:58 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Alberto Curiel

Hi,

I am using chatgp to program oxygenbasic and use smtp.

the problem is the first line of code:

#include once "O2Gui+"

Chatgp says that Oxygenbasic has that library.
And I dont find it, nor in the documentation.

Chatgp locates the library inside the extras folder in Oxygenbasic:

"The O2Gui library for OxygenBasic can be found on the OxygenBasic GitHub repository. You can access it by following this link: https://github.com/Charles-Pegge/OxygenBasic

Once on the repository page, you can navigate to the "Extras" folder and then select the "O2Gui" folder. There you will find the O2Gui library with various examples and documentation.

Alternatively, you can directly access the O2Gui library folder using this link: https://github.com/Charles-Pegge/OxygenBasic/tree/master/Extras/O2Gui
"

but there is no extras folder in github now.

this library is supposed to run smtp on oxygenbasic.

my question is if this library existed in oxygenbasic,or exists?
if yes, where can I download it?


thank you
  •  

Charles Pegge

Hi Alberto,

GitHub seems to be having hallucinations, or maybe it is clever enough to see into the future! We normally use windows API calls and controls directly without any intermediate code.

Zlatko Vid

QuoteGitHub seems to be having hallucinations,

good one Charles  ;D  ;D  ;D

Quoteor maybe it is clever enough to see into the future!

that must be the case  ..OMG  :o  :o  :o

We normally use windows API calls and controls directly without any intermediate code.

Yes Alberto ..use that method  ;)

  •  

Charles Pegge

I should say ChatGPT is hallucinating rather than GitHub. Alberto, If you have any ChatGPT samples of OxygenBasic I'd be interested to see them, and perhaps discover what sources and strategies it is using.


Theo Gottwald

#5
Quote from: Alberto Curiel on July 16, 2023, 04:13:58 PMHi,

I am using chatgp to program oxygenbasic and use smtp.

the problem is the first line of code:

#include once "O2Gui+"

Chatgp says that Oxygenbasic has that library.
And I dont find it, nor in the documentation.

Chatgp locates the library inside the extras folder in Oxygenbasic:

"The O2Gui library for OxygenBasic can be found on the OxygenBasic GitHub repository. You can access it by following this link: https://github.com/Charles-Pegge/OxygenBasic

This is common behavior with LLM's when they do not know the programming language that you ask for.
ChatGPT currently does not know OxygenBasic.

So what is he doing?
What they do is, they make the code in Python and try to translate it somehow into your language.
You can see this very easy with the new, useless Google BARD.

So don't worry, the problem is just that there are not enough Samples for this language out there.
What you do is, you correct the AI. You click the "DISLIKE" Icon in the upper right corner and the field that
pops up, you explain whats wrong. In my experience the AI will learn very fast, in 1-2 weeks it will be already better in O2, if you keep it going.

Let me add that for this what you are doing, PureBasic would save you tons of time because it has libraries that will do that with a few lines and ChatGPT knows them.

Using GPT4 and copying the help-page of the sendmail command into the chat i get this:

Thank you for the information. It seems that PureBasic does indeed have a built-in `SendMail` command that simplifies the process of sending an email via SMTP. Here's how you might use it:

```purebasic
; Define your email, SMTP server, and login credentials
Email$ = "your-email@example.com"
Password$ = "your-password"
SMTPServer$ = "smtp.example.com"
Receiver$ = "receiver-email@example.com"

; Create the email
If CreateMail(0, Email$, "Hello, this is a test email from PureBasic!")
  AddMailRecipient(0, Receiver$, #PB_Mail_To)
 
  ; Send the email
  Result = SendMail(0, SMTPServer$, 587, #PB_Mail_UseSSL, Email$, Password$)
 
  ; Check the result
  If Result <> 0
    Debug "Email sent successfully"
  Else
    Debug "Failed to send email"
  EndIf
Else
  Debug "Failed to create email"
EndIf
```

Please replace `"your-email@example.com"`, `"your-password"`, `"smtp.example.com"`, and `"receiver-email@example.com"` with your actual email address, password, SMTP server, and the receiver's email address.

This example uses port 587 and SSL encryption, which are common settings for SMTP servers, but you should check the documentation for your SMTP server to see what settings it requires.

Also, please note that sending email from a script can have many complications, such as dealing with SMTP authentication, handling errors, and dealing with spam filters. It's often easier to use a dedicated email sending service or library that handles these issues for you.

Before running the program, please make sure that you have the necessary permissions and you are not violating any terms of service.

Zlatko Vid

The easiest and similar way to learn how to make GUI app
with Oxygen Basic or o2 is to look into
VB 6.0 GUI win32 api programs ..translations is very easy
declaration of APi functions is same
IF you want do it right do it yourself ...not using chatGPT or any other "AI" program.
  •  

Charles Pegge

If VB6 doesn't work out, I would suggest asking chatGPT to code it in C++. Being a compiler, it would certainly be closer than Python, and would specify any specialised libraries which o2 would be able to use directly.

Alberto Curiel

Good to know that it is the AI that is failing, and not the oxygenbasic repo.

I was looking for that repo and sometimes I forgot that AI fails too
 ;D


I was trying just to send email from oxygenbasic.


maybe I deleted the code, because I dont find it in my computer.

but here are some other random examples,so you can have an idea:


You

write a program in oxygenbasic that sends email to a user
ChatGPT

Here is an example program in OxygenBasic that sends an email to a user using SMTP (Simple Mail Transfer Protocol). Make sure to replace the email sender and receiver details with your own information before running the program:

```basic
' Import required libraries
Import "mswsock.inc"
Import "wininet.inc"

---

make a program in oxygenbasic that sends a mail to a user using SMTP
ChatGPT

Here's an example program in OxygenBasic that sends an email using the SMTP protocol:

```oxygen
#include "core/oxygenbasic.h"
#include "network/smtp/smtpclient.inc"

----


You

write a program in oxygenbasic that is a smtp server
ChatGPT

Here's an example of a simple SMTP server written in OxygenBasic:

```oxygen
include "win32api.inc"
include "streamio.inc"


those .inc libraries, I guess are not from oxygenbasic.

thank you
  •  

Charles Pegge

Some internet demo code below. You might be able to adapt it for sending email.

Alberto Curiel

 wow,
thank you Charles for the sample code.
 ;D

  •