• January 27, 2023, 10:01:53 pm

Author Topic: Simple php code  (Read 5152 times)

chusrubi2

  • Guest
Simple php code
« on: January 19, 2011, 02:13:41 pm »
Heyho.
Well im making a website and i need some help.
Ive enough skills to understand any  php file with any code but i dont have enough to make one from 0.

Well what i need its just a little code that when u click on a simple button called "host" or whatever, it sends a command to the bot i have in bnet. What i thought is i could use webbot to send it but i dont know how to make this php code.

Any idea?

bb!

Scope

  • Founder
  • Main Administrator
  • Hero Member
  • *******
  • Posts: 3,143
    • BnetWeb
Re: Simple php code
« Reply #1 on: January 19, 2011, 02:44:30 pm »
WebBot will only interpret its predefined commands. You could send a chat message to webbot and it will store in the SQL and yiu can use your bot to retrieve it. But then your not looking at php, your looking at whatever language the bot is programmed in to pull the URL.

"Capitalization is the difference between helping your Uncle Jack off a horse and helping your uncle jack off a horse."

chusrubi2

  • Guest
Re: Simple php code
« Reply #2 on: January 19, 2011, 03:25:47 pm »
WebBot will only interpret its predefined commands. You could send a chat message to webbot and it will store in the SQL and yiu can use your bot to retrieve it. But then your not looking at php, your looking at whatever language the bot is programmed in to pull the URL.

Well "i think" i have understood u but im not sure.

Ill explain it better (if i can):

I make a or a link, and the thing i want it to do is just send for example /privby xxx (ive got sb with ghost bot plugin) into the webbots chat.

The part i didnt understand was "But then your not looking at php, your looking at whatever language the bot is programmed in to pull the URL."

Thanks.

pikachu

  • Administrator
  • Hero Member
  • *******
  • Posts: 3,344
Re: Simple php code
« Reply #3 on: January 19, 2011, 03:26:52 pm »
little code

Relatively speaking, it's more than a little code.  Do you have your own bot?  Do you know any languages besides PHP (C++, Visual Basic, Java, Python, C#)?  It might be easier to write a plugin for something like Stealth or l2k if not.

edit: you could have a form put the command into a database and then have your bot plugin poll a script that looks for new commands.
« Last Edit: January 19, 2011, 03:29:40 pm by pikachu »

chusrubi2

  • Guest
Re: Simple php code
« Reply #4 on: January 19, 2011, 03:39:31 pm »


Quote
you could have a form put the command into a database
ok.
Quote
and then have your bot plugin poll a script that looks for new commands.
i didnt understand this part.

pikachu

  • Administrator
  • Hero Member
  • *******
  • Posts: 3,344

Warden

  • Hero Member
  • *******
  • Posts: 1,745
  • BNTA Admin
    • Battle.net Terrorist Alliance
Re: Simple php code
« Reply #6 on: January 20, 2011, 12:48:06 am »
edit: you could have a form put the command into a database and then have your bot plugin poll a script that looks for new commands.

@edit - I already did this.

@OP - If you don't mind using newb scripts I can show you how to do this.

pikachu

  • Administrator
  • Hero Member
  • *******
  • Posts: 3,344
Re: Simple php code
« Reply #7 on: January 20, 2011, 12:51:10 am »
@edit - I already did this.

Want a medal?

Scope

  • Founder
  • Main Administrator
  • Hero Member
  • *******
  • Posts: 3,143
    • BnetWeb
Re: Simple php code
« Reply #8 on: January 20, 2011, 01:03:59 am »
From what I understand, you want to have a button on a website that sends a command to a bot like ".host <gamename>" and the bot receive and process the command sent via chat. This is possible to do with webbot, but you'd need a bot that has a plugin designed for webbot so receive the commands sent. You can't just send a command in php to a bot that isn't configured to receive it.

"Capitalization is the difference between helping your Uncle Jack off a horse and helping your uncle jack off a horse."

chusrubi2

  • Guest
Re: Simple php code
« Reply #9 on: January 21, 2011, 07:39:09 am »
From what I understand, you want to have a button on a website that sends a command to a bot like ".host <gamename>" and the bot receive and process the command sent via chat. This is possible to do with webbot, but you'd need a bot that has a plugin designed for webbot so receive the commands sent. You can't just send a command in php to a bot that isn't configured to receive it.


Well i have got SB 2.7 with webbot script, and the script of ghost bot follower, so its just make a php code (i think) that when i click on the button (or link) it sends throught webbot /priv asd .

Do i need something more? Thanks!
« Last Edit: January 21, 2011, 07:43:38 am by chusrubi2 »

pikachu

  • Administrator
  • Hero Member
  • *******
  • Posts: 3,344
Re: Simple php code
« Reply #10 on: January 21, 2011, 01:22:58 pm »
Do i need something more? Thanks!

Yeah, the whole back end of the webbot.  It's more than just "make a php code" that you're gonna need to get this going.  My suggestion would be to actually learn about what you're doing first before expecting us to have something you can just copy and paste into a file and get working.

If you don't have a reasonable understanding of web protocols, storing/retrieving data, server/client architecture and general programming, this isn't going to be an easy project.  If you have any questions about any of these things, we're more than happy to help--but it's gonna take some work on your part too.

chusrubi2

  • Guest
Re: Simple php code
« Reply #11 on: January 21, 2011, 02:00:22 pm »
Quote
it's gonna take some work on your part too.

My enthusiasm > Work.
All what you tell me to learn or to read is not gonna be any "work" for me, the only problem i ve is time.

- I know whats MYSQL, im working with it.
- I read your link of http://en.wikipedia.org/wiki/Pull_technology .

I am in nice project with some RoC friends, but just two of us know "a little" of this world.

If u wanna still contacting by here np, but if ure rly interested in help us or send hints about how to start in this part of the project (the most difficult, weve done the other 80%), i think it shud be better msn.

Anyway, thanks.


Scope

  • Founder
  • Main Administrator
  • Hero Member
  • *******
  • Posts: 3,143
    • BnetWeb
Re: Simple php code
« Reply #12 on: January 21, 2011, 02:11:53 pm »
Feel free to contact me by instant messenger, as I astill am having trouble understanding what exactly your needing to send/receive. But if its all done via stealthbot, then I think I understand what your doing.

AIM: ScopeXL, MSN: scope@bnetweb.org

"Capitalization is the difference between helping your Uncle Jack off a horse and helping your uncle jack off a horse."

pikachu

  • Administrator
  • Hero Member
  • *******
  • Posts: 3,344
Re: Simple php code
« Reply #13 on: January 21, 2011, 03:20:41 pm »
He basically wants a one-way webbot.  The site allows storage of a command that the bot will poll for, receive and send to Battle.net without actually relaying any of the Battle.net chat environment data back to the web server (i.e. no viewer).

warrior

  • Sr. Member
  • ******
  • Posts: 409
  • Jesus Christ.
Re: Simple php code
« Reply #14 on: January 21, 2011, 05:51:14 pm »
Your bot will either need to poll a service, or become a service itself, and have your web service push to that service when new data arrives. However you'll probably need x-domain policy file hosted on the bot too. In other words .. just do polling, lol.

Poll every X minutes (where X is determined by bandwidth vs responsiveness tradeoffs) for any entries stored in whichever medium you prefer and returned in whatever format you want.
In capitalist America, bank robs you.

Choosing to code in an unmanaged language/platform is like choosing a hotel where you have to clean your own room.

When C++ is your hammer, everything starts to look like your thumb

Vault

  • 卐 Dämonisch 卐
  • Hero Member
  • *******
  • Posts: 1,126
  • "When I see your smile Tears run down my face"
Re: Simple php code
« Reply #15 on: January 23, 2011, 09:58:36 am »
Your bot will either need to poll a service, or become a service itself, and have your web service push to that service when new data arrives. However you'll probably need x-domain policy file hosted on the bot too. In other words .. just do polling, lol.

Poll every X minutes (where X is determined by bandwidth vs responsiveness tradeoffs) for any entries stored in whichever medium you prefer and returned in whatever format you want.

Wanna know something funny?

He basically wants a one-way webbot.  The site allows storage of a command that the bot will poll for, receive and send to Battle.net without actually relaying any of the Battle.net chat environment data back to the web server (i.e. no viewer).

Your such a Assclown sometimes War, War.

warrior

  • Sr. Member
  • ******
  • Posts: 409
  • Jesus Christ.
Re: Simple php code
« Reply #16 on: January 23, 2011, 12:37:42 pm »
I'm the assclown, yet you've added nothing of value to the thread? Lol.

To the OP:
Alternatively, you can use http streaming (which implies some sort of policy for timing out and terminating long lived http connections) and since its only for a handful of users, scalability and resource usage should not be a problem. I literally just finished implementing this into a project of my own so I can verify that it works and is not too hard to do.
This post has been thanked 1 time ɥǝnяʎ ıן
In capitalist America, bank robs you.

Choosing to code in an unmanaged language/platform is like choosing a hotel where you have to clean your own room.

When C++ is your hammer, everything starts to look like your thumb

pikachu

  • Administrator
  • Hero Member
  • *******
  • Posts: 3,344
Re: Simple php code
« Reply #17 on: January 23, 2011, 02:36:50 pm »
Nelson, your first post was already way over his head...now you're just gonna confuse the poor boy.

chusrubi2

  • Guest
Re: Simple php code
« Reply #18 on: January 23, 2011, 03:53:42 pm »
Well i talked with scope, and all is more simple that i thought reading you.

Thanks all for help, i got what i needed.

 

newBalance by DzinerStudio