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 


Re-New : CEListView index vs Table index

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1668

PostPosted: Thu Apr 04, 2019 3:42 am    Post subject: Re-New : CEListView index vs Table index Reply with quote

Sorry for posting on a new thread.

This is my function to save listview item and subitem to a table.

Code:
function saveCrntTbl()
 if MessageDialog('Save the latest list? Continue?', mtConfirmation, mbYes, mbNo, mbCancel, 0) == mrYes then
 clearTable(hack_table)
 hack_table.Index = 0
 --table.insert(hack_table,{name = "---------", url = "---------", last_update = "-------"})
 list = plist
 list.ItemIndex = 0
 z = list.items.Count
 for i=1,z-1 do
--  game_name = list.Items[list.ItemIndex+i].Caption
  game_name = list.Items[i].Caption
--  url_name=list.Items[list.ItemIndex+i].SubItems[0]
  url_name=list.Items[i].SubItems[0]
--  lsupdate=list.Items[list.ItemIndex+i].SubItems[1]
  lsupdate=list.Items[i].SubItems[1]
  hack_table[i] = {name = game_name, url = url_name, last_update = lsupdate}
 end
 player_path = TrainerOrigin or getMainForm()
 table.save(hack_table,player_path..'\\myhacktable.lua')
 return player_path
 end
end


Say, I have 3 items and subitems on listview list. When it saved to a table by using the function above it only saved 2 items and subitems to the table. Where I did a mistake on my function above?.

Thanks

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Thu Apr 04, 2019 4:21 am    Post subject: Reply with quote

for i=1,z-1 do should be for i=0,z-1 do

and hack_table[i] should be hack_table[i+1]

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1668

PostPosted: Thu Apr 04, 2019 7:45 am    Post subject: Reply with quote

Sorry, because can't double post, I deleted my post before this.

I am facing 2 problems with my listview.

1. If using a listbox, then easy to delete an item.

Code:
list = plist  --- listbox name
x = list.itemIndex
list.items.Delete(x)


But this doesn't work with a listview (with the item with 2 subitems for each item). So, how I delete a single item including his subitems on a listview (by using his index or use another way)?.

2. I am able to get listview subitem (in this case is a URL link) and store as a string variable.

Code:
function executeHackTbl()
 x = list.itemIndex
 url_name=list.Items[x].SubItems[0]
 --print(url_name)
 local url = url_name
 local int = getInternet()
 local text = int.getURL(url_name)
 int.destroy()
 load(text)()
end

plist.onDblClick = executeHackTbl


By executing the function above it load lua script table from the provided link and execute it as normal. But after that (double click listview item to call the function), all my button clicks event on my main form give Error Access Violation. What is wrong?.

My list view properties:

Code:
plist = createListView(f)
plist.BorderStyle = 'bsSingle'
plist.Font.Color = '0x00DFF7FF'
plist.Color = f.color
plist.Width = 584
plist.Left = lbl1.left
plist.Top = btnHckTbl.top + btnHckTbl.height + 10
plist.Height = 125
plist.TopIndex = 0
plist.itemIndex= -1
plist.MultiSelect = false
plist.Sorted = true
plist.RowSelect = true
plist.ShowColumn = true
plist.ViewStyle = 'vsReport'
plist.ScrollBars = 'ssAutoVertical'
plist.RowSelect = true
plist.GridLines = true
plist.ColoumnClick = false
plist.ReadOnly = true
lvc=listview_getColumns(plist)
col1=listcolumns_add(lvc)
col2=listcolumns_add(lvc)
col3=listcolumns_add(lvc)
col1.Caption = 'Game'
col2.Caption = 'URL'
col3.Caption = 'Updated'
col1.width = 100
col2.width = 384
col3.width = 95


Any solution?.

And DB thanks for the answer for listview index solution. Very Happy



CRDR Online Hack Table Loader.JPG
 Description:
 Filesize:  71.95 KB
 Viewed:  3952 Time(s)

CRDR Online Hack Table Loader.JPG



_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1668

PostPosted: Thu Apr 04, 2019 5:14 pm    Post subject: Reply with quote

SOLVE No. 1

To delete an entry from listview.

Code:
list = plist
local i=list.Selected.Index
list.Items[list.ItemIndex].Delete(i)


Last unsolve is no.2 above

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Thu Apr 04, 2019 10:50 pm    Post subject: Reply with quote

perhaps something in your script you downloaded is destroying form objects or overwriting references to different objects
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1668

PostPosted: Fri Apr 05, 2019 12:49 am    Post subject: Reply with quote

Dark Byte wrote:
perhaps something in your script you downloaded is destroying form objects or overwriting references to different objects


You are right, DB. Something missing on my downloaded script.
I forgot to add an event handler to close form/exit on my downloaded script.

Now, my form downloader work correctly. Just one problem. When executing url link to download and execute the script from online storage (e.q: raw data from pastebin site) which that script contain code:

Code:
function closed()
 closeCE()
 return caFree
end

form.onClose = closed


Then when this function called to close the form (from the downloaded script), my form downloader will
close too. So, I consider saving hack script table as a CT file to the online storage site and when it downloads should be saved as a local file or table file and executing by use loadtable().

Rgds

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 37

Joined: 16 Feb 2017
Posts: 1516

PostPosted: Fri Apr 05, 2019 7:38 am    Post subject: Reply with quote

@Corroder;
If I don't get it wrong:
You can do the shutdown command without affecting the main form.

Code:
F1 = createForm(true)
F1.Position = poDesktopCenter
F1.Width = 130
F1.Height = 100
F1.BorderStyle = "bsNone"
F1.Color = "0x123456"
F1.OnMouseDown = function() F1.DragNow() end

b1 = createButton(F1)
b1.Left = 30
b1.Top = 30
b1.Caption = "Close"
b1.OnClick = function()
F1.close()
--F1.Destroy()
end


Additionally: Update or Download Manager
We've done the subject before.
To download the form as a string:
It sees some unreadable characters as Error!
Use .CETRAINER instead of .CT.
And this is only a recommendation.
I'll make the sample code.

Note: Dropbox gives "Extreme Traffic" error
and it causes the download page to crash.
You can recommend; Is there a direct download site?

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1668

PostPosted: Fri Apr 05, 2019 8:57 am    Post subject: Reply with quote

Aylin wrote:
@Corroder;
If I don't get it wrong:
You can do the shutdown command without affecting the main form.
..
..


Yes, you were right, with destroying the downloaded object. Actually, I make this 'downloader manager' with some options. (Note: I already have one in C# format). The options are:

1. Able to download CT, CETRAINER, Text and executable file or script.
2. Offering to direct execution or save the downloaded table to local disk
3. Downloader manager not just for online, it also provided to handle local file

About your suggestion to save as CETRAINER to avoid script stolen, I do not really care for this time because I make the project for personal use. Besides, CE has encoded decode function and also I have my own decoded encode function.

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 37

Joined: 16 Feb 2017
Posts: 1516

PostPosted: Fri Apr 05, 2019 1:39 pm    Post subject: Reply with quote

I did some research.
Below is the method that you can use as "Warehouse Area".
In fact: You do not need to publish the site.
Only store and use.
Warehouse site and illustrated, use tutorial links were dropped.

https://sites.google.com/site/sites/system/app/pages/meta/dashboard/create-new-site

http://koruorman.blogspot.com/2016/07/direk-indirme-linki-yapma.html

Again a suggestion Smile : In the version query Screen, Link showing!
Only the new version of the Trainer name should appear.
The warehouse must always remain hidden.
Example: No; "Game, Url, Updated"
Maybe; "Game, Updated Description, Updated"
Good luck with. Wink

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1668

PostPosted: Fri Apr 05, 2019 7:53 pm    Post subject: Reply with quote

@Aylin :
Quote:
Again a suggestion: In the version query Screen, Link showing!
Only the new version of the Trainer name should appear.


As I said, I make the project for my personal use. Not plan to publish or share. The project should be for tracking all my hack tables, that is why I need to know for the game name, path location (online/offline), when and how many times the updated.

For my online script/hack table, I use: https://pastebin.com/
and of course some other online storage link like mega, google, etc

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
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