Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Check Online/Offline in Lua . Help Me

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Sting9x
Cheater
Reputation: 0

Joined: 27 Jul 2016
Posts: 47

PostPosted: Sat Feb 18, 2017 6:23 am    Post subject: Check Online/Offline in Lua . Help Me Reply with quote

Hello Admin and member ,here is my code Php
Code:
php

i will set name for it is user.php Very Happy . When someone uses the program. It will be called in connection to link to domain.com/user.php?online .
and when they do not use anymore. They will be referred to to link domain.com/user.php?offline
Who has the code to help me implement ideas that? Surprised If yes please help me .


Last edited by Sting9x on Sun Feb 19, 2017 8:00 am; edited 1 time in total
Back to top
View user's profile Send private message
Sting9x
Cheater
Reputation: 0

Joined: 27 Jul 2016
Posts: 47

PostPosted: Sat Feb 18, 2017 10:34 pm    Post subject: Reply with quote

Help Confused Confused Confused Confused Confused Confused Confused Confused
Back to top
View user's profile Send private message
Corroder
Master Cheater
Reputation: 8

Joined: 10 Apr 2015
Posts: 403

PostPosted: Sun Feb 19, 2017 1:34 am    Post subject: Reply with quote

Not sure what you trying to do, since this forum is for lua script.
But if you want php script within lua, take a look this :

http://www.php.net/manual/en/book.lua.php
http://php.net/manual/en/lua.registercallback.php

or you need PECL : http://www.laruence.com/lua/
Back to top
View user's profile Send private message
Sting9x
Cheater
Reputation: 0

Joined: 27 Jul 2016
Posts: 47

PostPosted: Sun Feb 19, 2017 2:06 am    Post subject: Reply with quote

Corroder wrote:
Not sure what you trying to do, since this forum is for lua script.
But if you want php script within lua, take a look this :

http://www.php.net/manual/en/book.lua.php
http://php.net/manual/en/lua.registercallback.php

or you need PECL : http://www.laruence.com/lua/

I mean, I want the user to restart the program it will link to links domain.com/user.php?online
and when they do not use anymore. They will be referred to to link domain.com/user.php?offline Very Happy
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 329

Joined: 09 May 2003
Posts: 19510
Location: The netherlands

PostPosted: Sun Feb 19, 2017 5:32 am    Post subject: Reply with quote

use getInternet and fetch that url

and add an onclose grt the offline one

and i recommend you also use a timer that every 5 minutes that calls a 'stillonline' so you can deal with crashes

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Back to top
View user's profile Send private message MSN Messenger
Sting9x
Cheater
Reputation: 0

Joined: 27 Jul 2016
Posts: 47

PostPosted: Sun Feb 19, 2017 7:59 am    Post subject: Reply with quote

Dark Byte wrote:
use getInternet and fetch that url

and add an onclose grt the offline one

and i recommend you also use a timer that every 5 minutes that calls a 'stillonline' so you can deal with crashes

Tks . it works very well Very Happy
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 118

Joined: 09 Jun 2013
Posts: 3197

PostPosted: Sun Feb 19, 2017 8:54 am    Post subject: Reply with quote

His original PHP code was:
Code:
<?php
function ReadOnline()
{
   $filename  = "online.txt";
   $myfile = fopen($filename,"r+");
   $buffer = fread($myfile, filesize($filename) );
   fclose($myfile);
   return $buffer;
}
function WriteOnline($count)
{
   $filename  = "online.txt";
   $myfile = fopen($filename,"w");
   $buffer = fwrite($myfile, $count );
   fclose($myfile);
}
if (isset($_GET['online']))
{
   $count = ReadOnline();
   if ($count < 0) $count = 0;
   $count += 1;
   WriteOnline($count);
}
else
if (isset($_GET['offline']))
{
   $count = ReadOnline();
   $count -= 1;
   if ($count < 0) $count = 0;
   WriteOnline($count);
}
else
{
   $count = ReadOnline();
   echo "User Online:".$count;
}


?>
Back to top
View user's profile Send private message
Corroder
Master Cheater
Reputation: 8

Joined: 10 Apr 2015
Posts: 403

PostPosted: Sun Feb 19, 2017 8:29 pm    Post subject: Reply with quote

Where is "his php" script ??
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 73

Joined: 29 Oct 2010
Posts: 3563

PostPosted: Sun Feb 19, 2017 8:34 pm    Post subject: This post has 1 review(s) Reply with quote

He tried removing it, so Zanzer kindly added it back. Very Happy
Back to top
View user's profile Send private message
Corroder
Master Cheater
Reputation: 8

Joined: 10 Apr 2015
Posts: 403

PostPosted: Mon Feb 20, 2017 7:37 am    Post subject: Reply with quote

++METHOS.... ah I see.. Don't know why or what reasons, some member did like that (posted and delete his/her own post)...
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 73

Joined: 29 Oct 2010
Posts: 3563

PostPosted: Mon Feb 20, 2017 9:18 am    Post subject: Reply with quote

He probably did not want anyone using his code or knowing how to replicate what he was doing. Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites